Hi team!
I’ve been having some issues building my Android application for the last few days. I was getting an error from react-native-unimodules when building my Android app which was saying that my “MainApplication” file couldn’t be found (talked about this here).
I’ve since updated to SDK 43 to get rid of unimodules. App now build successfully, but crashes upon open with a very similar error. Heres the results after debugging with adb logcat
.
12-04 12:52:10.347 7632 7632 E AndroidRuntime: java.lang.RuntimeException: Unable to
instantiate application build.skillspace.mobile.MainApplication:
java.lang.ClassNotFoundException: Didn't find class "build.skillspace.mobile.MainApplication" on
path: DexPathList[[zip file "/data/app/build.skillspace.mobile-u__xdzVX3RoMy92XhV-
UKg==/base.apk"],nativeLibraryDirectories=[/data/app/build.skillspace.mobile-
u__xdzVX3RoMy92XhV-UKg==/lib/x86, /data/app/build.skillspace.mobile-
u__xdzVX3RoMy92XhV-UKg==/base.apk!/lib/x86, /system/lib, /system/product/lib]]
Everything builds just fine locally. Build succeeds and runs as expected. Never had this issue until recently (though last build was a few months ago) and very little has changed in my android project (except for what I’ve now had to change when updating from SDK 40 to 43). When I was hitting this issue earlier in the week, absolutely nothing had changed at all.
I’m not sure how to debug any further since my local runs fine, build runs fine, but I still get this issue. I SUSPECT it could maybe have to do with my package name (build.skillspace.mobile) since the path includes the world “build” (resulting in app/src/main/java/build/skillspace/mobile/MainApplication.java). I actually had this issue in the past and had to instruct git to to INCLUDE this specific path in git (!build/ in app/src/main). I however have 0 clue how to check if this is for some reason the case again even though it hasn’t caused any issues in a long while. I WOULD try just renaming my package but I don’t believe the Play Store would let me do that.
Any help would really really be appreciated, this issue has kept me from releasing updates for about a week now.
Thanks!