我有一個類似的錯誤
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/mick/Codes/git/projects/alerto-balita/AlertoBalitaApp/android/app/build.gradle' line: 3
* What went wrong:
Could not compile build file '/Users/mick/Codes/git/projects/alerto-balita/AlertoBalitaApp/android/app/build.gradle'.
> startup failed:
build file '/Users/mick/Codes/git/projects/alerto-balita/AlertoBalitaApp/android/app/build.gradle': 3: unable to resolve class com.android.build.OutputFile
@ line 3, column 1.
import com.android.build.OutputFile
^
1 error
在我來說,我不小心在項目build.gradle
刪除classpath 'com.android.tools.build:gradle:2.3.3'
回到它解決了這個問題,編譯
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}