I ported my app from Eclipse to Android Studio, and now my app won't run. Just to be clear, I did not export from Eclipse. I created a new project in Android Studio, and manually cut/pasted every class in my project.
I am running Android Studio on a new Macbook Pro - Yosemite. I am having some issues running my app, even though it compiles. From what I can see, my problem might be that I am using JDK 1.8. Well, I cannot figure out how the heck to get JDK 6.
Here is the error I get when I run the project in Android Studio
Error:Execution failed for task ':app:preDexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
When I scroll up in the Gradle Event Log, I see this error:
com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
In addition to the app not running, Android Studio freezes a lot! Again, is this because of the version of Java I have installed?
2 Answers 2
Wait, why didn't you IMPORT the project using Android Studio? It will build the gradle files for you.
enter image description here
Choose New/Import Project...
Then you will see it will let you just point to the root directory of your eclipse project:
enter image description here
10 Comments
Ok, installing JDK 7 fixed the issue. So, this Macbook is brand new, running Yosemite. It didn't have a JDK installed already. When I ran Android Studio, it said no JVM found. So, I went and got the latest from Oracle. So the only JDK I had was JDK 8.
So, for whatever reason, installing JDK 7 has made it so my app will actually run... Whoo Hoo! I'm back in business.
1 Comment
Explore related questions
See similar questions with these tags.