2016-01-06 148 views
11

我拿起別人的項目,當我問到運行在我的AVD項目,它會彈出我的錯誤:執行失敗的任務:應用程序:compileDebugJavaWithJavac

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

這裏是我的build.gradle

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 23 
buildToolsVersion "23.0.2" 
defaultConfig { 
    applicationId 'ca.gggolf.aminutegolf' 
    minSdkVersion 19 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 

buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
productFlavors { 
} 
} 

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
testCompile 'junit:junit:4.12' 
compile 'com.android.support:appcompat-v7:23.1.1' 
} 

我不知道該怎麼辦..其他一切正常,應用程序在幾年前第一次製作時就工作了。

謝謝

+0

是最初爲Eclipse編寫的項目嗎?你說這已經過了幾年了,這就是我問的原因。 – emerssso

+0

是的,這是.... – dequec64

+0

請添加你的'build.gradle'並告訴我你正在使用的Android Studio的版本 – piotrek1543

回答

0

我回到這個問題只是因爲它有很多意見。

首先,感謝所有的幫助。我設法通過在Android Studio上創建一個新項目並一次導入一個類,同時確保代碼仍然正常運行應用程序。也許創建一個新項目會添加一些參數,這些參數在舊版本的項目中不存在。

如果有人有更好的解釋,隨時回答!

+0

創建一個新項目和逐個複製類是不可能的一些項目,其中有很多文件到它.. –

+0

我知道,我不認爲這是最好的解決方案,我只是說,它爲我工作 – dequec64

2

爲您的項目啓用multidex。下面添加行搖籃defaultConfig:

multiDexEnabled true 

同時添加multidex依賴於gradle產出的依賴關係:

compile 'com.android.support:multidex:1.0.1' 
+0

這有助於。非常感謝! –

0

檢查LIB版本。在我的情況下,這是老的Realm插件,這是一個問題。

0

檢查您現有項目的位置地址。如果在文件夾和子文件夾名稱中使用特殊字符(如|(| | + = * ...)),則應更改並檢出它。

我將我的文件夾名稱從「UI/UX」更改爲「UiUx」及其完成:)