Closed jlugner closed 8 years ago
I just had this error and fixed it by doing npm install
again on my node packages, but I'm not sure what the cause of mine was (but I was using this icons module).
You may want to update React Native to 0.16.0 as well
Thanks, Cory Smith On Wed, Dec 9, 2015 at 7:14 AM, corymsmith/react-native-icons reply@reply.github.com wrote: I just had this error and fixed it by doing npm install again on my node packages, but I'm not sure what the cause of mine was (but I was using this icons module).
— Reply to this email directly or view it on GitHub [https://github.com/corymsmith/react-native-icons/issues/150#issuecomment-163249602] .[https://github.com/notifications/beacon/AAAck2x1vx1YHuOCvEDFrzSgq1jCaKt_ks5pOC7NgaJpZM4Gx4PF.gif]
Reinstalling modules did not help unfortunately. Upgrading to 0.16.0 seems to be quite a hassle seeing as I'm quite far into development on this application? Should it work with earlier versions, or is it limited to 0.16.0?
Can you share a gist of your build.grade file?
Thanks, Cory Smith On Thu, Dec 10, 2015 at 2:53 AM, corymsmith/react-native-icons reply@reply.github.com wrote: Reinstalling modules did not help unfortunately. Upgrading to 0.16.0 seems to be quite a hassle seeing as I'm quite far into development on this application? Should it work with earlier versions, or is it limited to 0.16.0?
— Reply to this email directly or view it on GitHub [https://github.com/corymsmith/react-native-icons/issues/150#issuecomment-163560068] .[https://github.com/notifications/beacon/AAAck3XwU3xv6rwEV1ecf-6ZUDV8MiCvks5pOUMIgaJpZM4Gx4PF.gif]
I can get a bit further in compiling if I change
mReactInstanceManager.onResume(this);
to
mReactInstanceManager.onResume(this, this);
However, the later version crashes with following exception:
:app:transformClassesWithDexForDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/facebook/infer/annotation/Assertions;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
:app:transformClassesWithDexForDebug FAILED
Gist of my android/app/build.gradle: https://gist.github.com/Pungsnigel/7ebb1447920e3d366e54
I see the issue, your RN JS is out of sync with the RN Java library. You'll have to change: compile " com.facebook.react:react-native:0.14.+ " To: compile " com.facebook.react:react-native:0.16.+ "
Then make sure you restart the packager.
Getting same error, regardless of which of above versions of MainActivity.java I use. Since I'm using react-native 0.14.2, should I really use compile " com.facebook.react:react-native:0.16.+ "?
I meant upgrade to RN 0.16.0 and ensure to update your .gradle file as well. The fact that you're MainActivity requires this with 2 parameters indicates that its pulling in newer Java code thats out of sync with the JS code.
mReactInstanceManager.onResume(this, this);
This was changed in this commit: https://github.com/facebook/react-native/commit/3dca8cf9fdd864b1359fc7276bf98cb154c3e360
I'm only required to use two parameters to if I add compile project(':react-native-icons') to my build.gradle. Otherwise, it works just fine with one. I'll try to upgrade RN and see if that works better.
You can also try version 0.6.1 which uses React Native 14 if you don't want to upgrade, should work but no guarantees.
By upgrading to RN 0.16, and enabling multidex(did not work without it, guide here: http://developer.android.com/tools/building/multidex.html), it seems to be working. Don't really know why I had to enable multidex, but I'll have to research it. Thanks for your help!
Multidex is required if you're app includes over 65,000 methods (including from included libs). I have it on multiple apps as well.
Thanks,
Cory Smith http://ca.linkedin.com/in/corysmith/ http:/twitter.com/smixx http://twitter.com/smixx
On Thu, Dec 10, 2015 at 8:52 AM, Jesper Persson notifications@github.com wrote:
By upgrading to RN 0.16, and enabling multidex(did not work without it, guide here: http://developer.android.com/tools/building/multidex.html), it seems to be working. Don't really know why I had to enable multidex, but I'll have to research it. Thanks for your help!
— Reply to this email directly or view it on GitHub https://github.com/corymsmith/react-native-icons/issues/150#issuecomment-163667664 .
Great. Thanks for your answers. Closing, as everything seems to work now.
Thanks guys! I went from 0.14 to 0.17 and this issue helped me get things working.
I'm getting a build error when adding react-native-icons as a compile target in my build.gradle file. I'm using react-native 0.14.2 The error: