I am developing an Android App in Android Studio. Not quite sure what went wrong. I was successfully building a few days ago. Any help would be great.
Here is the error:
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Here is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "21.1.2"
defaultConfig {
multiDexEnabled true
applicationId "com.tubbs.citychurchob"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile 'com.parse.bolts:bolts-android:1+'
compile 'com.android.support:recyclerview-v7:23.1.0'
}
I had this same issue. I was working with a team of developers using a Mac and everybody else on the team was running Windows. However we were using the Anroid Studio 2.2-beta with jdk 1.8. If you are on a mac and come across this issue, here is how to solve it. DONT USE Android Studio 2.2-beta. I spent hours trying to debug this error in 2.2-beta. I solved it by simply changing to Android Studio 2.1.3. Our app ran instantly after changing the Android Studio version. Also on Android Studio's website before you download it warns mac users about running jdk 1.8 on 2.2 beta. Guess I should have read the fine print haha
Changing anything in build.gradle file will re-sync everything again and the error will be gone.For me i changed the minSdkVersion and it worked. Don't worry this could happen if the system crashed or Android Studio was not shut properly.
If all the above didn't work for you try removing cache from
.gradle
global folderTry the following
rm -rf ~/.gradle/caches
react-native run-android
If didn't work, the below worked perfectly for me
rm -rf ~/.gradle
react-native run-android
I got this issue solved.
I was trying to compile this project "Waveform Android" - https://github.com/Semantive/waveform-android
and got I this error.
I am using Android studio on Ubuntu 14.04LTS.
I have JAVA 8 Installed.
in my gradle build script file there was some statements as below.
I changed the "JAVA8_HOME" to "JAVA_HOME" because in my environment variables the java home directory is set as JAVA_HOME not as JAVA8_HOME and then It built succesfully.
after changing the build script.
Or the other way you can create a new environment variable named JAVA8_HOME pointing to the right JDK location, but I have not tried that though because I dont want environment variables for each JDK version.
This kind of problem really make us anxious because of that no more useful information will be provided.
I don't know we are really the same,but I can provide two ways to help us try to solve the problem.
1.Firstly you can try to restart your Android Studio & your computer.In China,we have a saying between developers.
Little problems,just restart.Big problems,should reinstall.
The above saying will help you to solve this kind of problem many times.
2.Secondly we need to use some gradle command to help you to find more useful details.
I have met the similar situation as below:
You know that the above log is not useful for us to solve this kind of problem.We need to do some gradle command to find more useful information.
Note:I use macOS(10.13) and Android Studio(3.1)
Go to your Android project directory to execute the gradle command below:
Note:If you have permission problems while executing the above command,you can use this to deal with it:
And then I got this(Some unimportant parts are omitted):
I have got the most important details information,because of one module imported not properly which makes the class not found.So, I got it and solve the problem.
Some other gradle command:
Remember that the more details will help you to solve the problem the more.
I had this issue on Mac OS Sierra on my way to running a React Native Android App for the first time:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not find tools.jar
I changed my JAVA HOME environment variable for Java Development Kit (JDK) from:
export JAVA_HOME='/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home'
to :
export JAVA_HOME='/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home'
I figured out where the correct version was after creating a project in Android Studio and looking for the JDK location in the project settings.