f111fei / react-native-unity-view

Show an unity view in react native
MIT License
401 stars 102 forks source link

Error compiling in Android #54

Closed vadhack closed 6 years ago

vadhack commented 6 years ago

I cant build my app, please help me,

Im developing a react-native app in Linux Ubuntu 18.04 Unity app is build in Unity3d Editor in Linux the unity3d app was build successfully

in my project: /android/app/build.gradle: android { compileSdkVersion 23 buildToolsVersion "23.0.1" ...

but when compiling in android show this error:

:app:transformClassesWithDexForDebug Running dex in-process requires build tools 23.0.2. For faster builds update this project to use the latest build tools. Dex: Error converting bytecode to dex: Cause: Dex cannot parse version 52 byte code. This is caused by library dependencies that have been compiled using Java 8 or above. If you are using the 'java' gradle plugin in a library submodule add targetCompatibility = '1.7' sourceCompatibility = '1.7' to that submodule's build.gradle file. UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.RuntimeException: Exception parsing classes at com.android.dx.command.dexer.Main.processClass(Main.java:752) at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718) at com.android.dx.command.dexer.Main.access$1200(Main.java:85) at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645) at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) at com.android.dx.command.dexer.Main.processOne(Main.java:672) at com.android.dx.command.dexer.Main.processAllFiles(Main.java:569) at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366) at com.android.dx.command.dexer.Main.run(Main.java:275) at com.android.dx.command.dexer.Main.main(Main.java:245) at com.android.dx.command.Main.main(Main.java:106) Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000) at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472) at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406) at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388) at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251) at com.android.dx.command.dexer.Main.parseClass(Main.java:764) at com.android.dx.command.dexer.Main.access$1500(Main.java:85) at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684) at com.android.dx.command.dexer.Main.processClass(Main.java:749) ... 12 more

1 error; aborting :app:transformClassesWithDexForDebug FAILED

Please help me

mtostenson commented 6 years ago

Did you have any luck with this?

vadhack commented 6 years ago

Well, i updated buildToolsVersion "23.0.1" to "27.0.3" and then compiled but doesnt work anyway

twelch commented 6 years ago

You might try running a 'clean' action on your project and doing a full rebuild. I think I've seen this error on other projects after updating dependencies/build tools and having stale compiled resources around. Just an idea.

alisherakb commented 5 years ago

Any updates on issue?