java - "Bad class file magic" from setting up Android Studio for NDK -
i'm setting project work androids ndk. have use experimental gradle plugin. gradle syncs without errors , make without errors. when try 'run app' gradle gives error message:
unexpected top-level exception: error:com.android.dx.cf.iface.parseexception: bad class file magic (cafebabe) or version (0034.0000) @ com.android.dx.cf.direct.directclassfile.parse0(directclassfile.java:472) @ com.android.dx.cf.direct.directclassfile.parse(directclassfile.java:406) @ com.android.dx.cf.direct.directclassfile.parsetointerfacesifnecessary(directclassfile.java:388) @ com.android.dx.cf.direct.directclassfile.getmagic(directclassfile.java:251) @ com.android.dx.command.dexer.main.parseclass(main.java:764) @ com.android.dx.command.dexer.main.access$1500(main.java:85) @ com.android.dx.command.dexer.main$classparsertask.call(main.java:1684) @ com.android.dx.command.dexer.main.processclass(main.java:749) ... 19 more
from previous questions can see might depend on me using java 8 , android requiring java 7. other projects compile , run without issue.
i missed this answer , code snippet solved problem.
model { android { compileoptions.with { sourcecompatibility = javaversion.version_1_7 targetcompatibility = javaversion.version_1_7 } ... //rest of gradle code } }
sloppy research side.
Comments
Post a Comment