Android Studio preDexDebug After Adding jar File

后端 未结 1 875
暗喜
暗喜 2021-01-13 01:33

I have a framework of my own that I use for in-class tasks (school class, not Java class), and I made it into a .jar file so that whenever I make changes to the

相关标签:
1条回答
  • 2021-01-13 01:42

    Turns out Java 8 is not yet supported by the Android SDK (Or something along those lines). Installing Oracle JDK 7 on my desktop, and recompiling my .jar fixed the issue completely.

    The most important part was in the second line of the error produced: "bad class file magic (cafebabe) or version (0034.0000)". 0x34 is hex for 52, which means that the binaries are targeted for JREs that support Java 8, but Android Studio's system requirements state that JDK 7 is required

    Steps to switch to Oracle JDK 7:

    1. Download JDK .tar from Oracle's site
    2. Untar contents to /opt/
    3. sudo update-alternatives --install /bin/java java /opt/jdk*version*/jre/bin/java 1023
    4. sudo update-alternatives --install /bin/javac javac /opt/jdk*version*/bin/javac 1023
    5. sudo update-alternatives --install /bin/jar jar /opt/jdk*version*/bin/jar 1023

    https://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre

    0 讨论(0)
提交回复
热议问题