Android build messed up - android

I'm developing a game for some time now under cocos2d-js. I was able to add plugin-x and facebook integration to android build. a few days ago I was trying to add admob as another plugin but i came across difficulties. I tried, for the first time ever to add the project to eclipse and try to deal with it there but I came up messing up the whole build. I tried to remove all the additions (admob, facebook, pluginx) and to start all over, but I keep getting this message after compilation & on-device-installation is done:
D/AndroidRuntime( 7513): Shutting down VM
W/dalvikvm( 7513): threadid=1: thread exiting with uncaught exception (group=0x41929ba8)
E/AndroidRuntime( 7513): FATAL EXCEPTION: main
E/AndroidRuntime( 7513): Process: com.shirkan.PiuPiu, PID: 7513
E/AndroidRuntime( 7513): java.lang.UnsatisfiedLinkError: Couldn't load cocos2djs from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.shirkan.PiuPiu-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.shirkan.PiuPiu-1, /vendor/lib, /system/lib]]]: findLibrary returned null
E/AndroidRuntime( 7513): at java.lang.Runtime.loadLibrary(Runtime.java:358)
E/AndroidRuntime( 7513): at java.lang.System.loadLibrary(System.java:526)
E/AndroidRuntime( 7513): at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:85)
E/AndroidRuntime( 7513): at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:99)
E/AndroidRuntime( 7513): at android.app.Activity.performCreate(Activity.java:5231)
E/AndroidRuntime( 7513): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 7513): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
E/AndroidRuntime( 7513): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
E/AndroidRuntime( 7513): at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime( 7513): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime( 7513): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 7513): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 7513): at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime( 7513): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7513): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 7513): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime( 7513): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime( 7513): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 490): Force finishing activity com.shirkan.PiuPiu/org.cocos2dx.javascript.AppActivity
Can anyone suggest what can cause such error?
Thanks.

Related

React Native App Crashes on Launch in Android (API 19)

Description
I have created a project with react-native-cli
When I launch the app using the command "react-native run-android" on Devices and Emulators with Android API level 21+ App is launching.
But for devices less than API 21, the app crashing on launch.
I have specified in android Gradle minSdk version to 16.
I viewed the stack trace using "adb logcat" the crash was due to OkHttp3 that is used internally in Facebook Flipper, which is expecting API 21+.
I haven't used any OkHttp3 Dependency explicitly in my app
React Native version:
6.14.4
Steps To Reproduce
Create a project using react-native CLI not Expo CLI
Navigate to the project folder
Connect a device or an emulator with API less than 21
run command "react-native run-android" to run the app on the connected device
Expected Results
The app should launch without any crash.
Android Logs
E/AndroidRuntime( 3745): java.lang.RuntimeException: Unable to create application com.infifive.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created
E/AndroidRuntime( 3745): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4347)
E/AndroidRuntime( 3745): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
E/AndroidRuntime( 3745): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime( 3745): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3745): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 3745): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime( 3745): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3745): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 3745): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 3745): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime( 3745): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 3745): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90)
E/AndroidRuntime( 3745): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238)
E/AndroidRuntime( 3745): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281)
E/AndroidRuntime( 3745): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87)
E/AndroidRuntime( 3745): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39)
E/AndroidRuntime( 3745): at com.infifive.MainApplication.onCreate(MainApplication.java:47)
E/AndroidRuntime( 3745): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
E/AndroidRuntime( 3745): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
E/AndroidRuntime( 3745): ... 10 more
E/AndroidRuntime( 3745): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 3745): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 3745): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80)
E/AndroidRuntime( 3745): ... 17 more
E/AndroidRuntime( 3745): Caused by: java.lang.ExceptionInInitializerError
E/AndroidRuntime( 3745): at okhttp3.OkHttpClient.newSslSocketFactory(OkHttpClient.java:263)
E/AndroidRuntime( 3745): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:229)
E/AndroidRuntime( 3745): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015)
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132)
E/AndroidRuntime( 3745): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183)
E/AndroidRuntime( 3745): ... 20 more
E/AndroidRuntime( 3745): Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
E/AndroidRuntime( 3745): at okhttp3.internal.platform.AndroidPlatform.buildIfSupported(AndroidPlatform.java:238)
E/AndroidRuntime( 3745): at okhttp3.internal.platform.Platform.findPlatform(Platform.java:202)
E/AndroidRuntime( 3745): at okhttp3.internal.platform.Platform.<clinit>(Platform.java:79)`
The only way I found to fix it is by commenting out all the code associated with flipper
GH thread here
This happens because of an internal check in the library called "okhttp" where the newer versions are supporting only API 21 and above. If possible, reduce the okhttp version, or anything related to it such as Glide or Retrofit etc. That will solve your problem.

Crash at startup on port to Cordova Crosswalk (Android)

I'm porting an existing android cordova app to cordova crosswalk.
Using cordova 4, crosswalk-cordova-10.39.235.9-x86 and Android SDK 19
The app crashes at startup with the following logs in logcat:
D/AndroidRuntime( 7208): Shutting down VM
W/dalvikvm( 7208): threadid=1: thread exiting with uncaught exception (group=0x41caeda0)
E/AndroidRuntime( 7208): FATAL EXCEPTION: main
E/AndroidRuntime( 7208): Process: myapp.cqa, PID: 7208
E/AndroidRuntime( 7208): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 7208): at org.apache.cordova.CordovaActivity.makeWebView(CordovaActivity.java:295)
E/AndroidRuntime( 7208): at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:348)
E/AndroidRuntime( 7208): at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:323)
E/AndroidRuntime( 7208): at myapp.cqa.CordovaApp.onCreate(CordovaApp.java:31)
E/AndroidRuntime( 7208): at android.app.Activity.performCreate(Activity.java:5451)
E/AndroidRuntime( 7208): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
E/AndroidRuntime( 7208): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2358)
E/AndroidRuntime( 7208): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2452)
E/AndroidRuntime( 7208): at android.app.ActivityThread.access$900(ActivityThread.java:172)
E/AndroidRuntime( 7208): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1302)
E/AndroidRuntime( 7208): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 7208): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 7208): at android.app.ActivityThread.main(ActivityThread.java:5586)
E/AndroidRuntime( 7208): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7208): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 7208): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
E/AndroidRuntime( 7208): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
E/AndroidRuntime( 7208): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 7208): Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Use SharedXWalkView if you want to support shared mode
E/AndroidRuntime( 7208): at org.xwalk.core.ReflectionHelper.handleException(ReflectionHelper.java:233)
E/AndroidRuntime( 7208): at org.xwalk.core.ReflectionHelper.handleException(ReflectionHelper.java:237)
E/AndroidRuntime( 7208): at org.xwalk.core.ReflectionHelper.init(ReflectionHelper.java:132)
E/AndroidRuntime( 7208): at org.xwalk.core.ReflectionHelper.loadClass(ReflectionHelper.java:199)
E/AndroidRuntime( 7208): at org.xwalk.core.XWalkPreferences.setValue(XWalkPreferences.java:112)
E/AndroidRuntime( 7208): at org.apache.cordova.CordovaWebView.<clinit>(CordovaWebView.java:890)
E/AndroidRuntime( 7208): ... 18 more
E/AndroidRuntime( 7208): Caused by: java.lang.RuntimeException: Use SharedXWalkView if you want to support shared mode
E/AndroidRuntime( 7208): ... 23 more
Any idea why it crashes ?
OK, after a night of sleeping, I realized I was using x86 crosswalk instead of the ARM one. Sorry for the dumb issue post...

java.lang.ArrayIndexOutOfBoundsException com.google.android.maps

I am getting this error in app that uses com.google.android.maps and the message is "Unfortunately the app has stopped."
E/AndroidRuntime( 3338): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
E/AndroidRuntime( 3338): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
E/AndroidRuntime( 3338): at
android.app.ActivityThread.access$600(ActivityThread.java:141)
E/AndroidRuntime( 3338): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
E/AndroidRuntime( 3338): at
android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(
3338): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime(
3338): at android.app.ActivityThread.main(ActivityThread.java:5039)
E/AndroidRuntime( 3338): at
java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(
3338): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 3338): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime( 3338): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime( 3338): at dalvik.system.NativeStart.main(Native
Method) E/AndroidRuntime( 3338): Caused by:
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
E/AndroidRuntime( 3338): at
com.google.android.maps.MapActivity.createMap(MapActivity.java:575)
E/AndroidRuntime( 3338): at
com.google.android.maps.MapActivity.onCreate(MapActivity.java:423)
E/AndroidRuntime( 3338): at
com.ee.map.MainActivity.onCreate(MainActivity.java:170)
E/AndroidRuntime( 3338): at
android.app.Activity.performCreate(Activity.java:5104)
E/AndroidRuntime( 3338): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
E/AndroidRuntime( 3338): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
E/AndroidRuntime( 3338): ... 11 more
Has anybody seen such error and do you know what can causes this?
What is in com.google.android.maps.MapActivity.createMap(MapActivity.java:575)?

App crashed when installed from Market but not if the Apk is installed manually.

My App works fine if I just install it manually by moving the apk onto the phone and installing it, however when I put it on the Market it crashes on the first Activity, this is the logcat.
E/AndroidRuntime( 999): FATAL EXCEPTION: main
E/AndroidRuntime( 999): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mbwasi.funapp/com.mbwasi.funapp.Splash}: java.lang.ClassNotFoundException: com.mbwasi.funapp.Splash in loader dalvik.system.PathClassLoader[/data/app/com.mbwasi.funapp-1.apk]
E/AndroidRuntime( 999): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime( 999): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)
E/AndroidRuntime( 999): at android.app.ActivityThread.access$2300(ActivityThread.java:132)
E/AndroidRuntime( 999): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
E/AndroidRuntime( 999): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 999): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 999): at android.app.ActivityThread.main(ActivityThread.java:4669)
E/AndroidRuntime( 999): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 999): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 999): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
E/AndroidRuntime( 999): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
E/AndroidRuntime( 999): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 999): Caused by: java.lang.ClassNotFoundException: com.mbwasi.funapp.Splash in loader dalvik.system.PathClassLoader[/data/app/com.mbwasi.funapp-1.apk]
E/AndroidRuntime( 999): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
E/AndroidRuntime( 999): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
E/AndroidRuntime( 999): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
E/AndroidRuntime( 999): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime( 999): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)
E/AndroidRuntime( 999): ... 11 more
What could be happening here? I also notice in the log that the apk name has a -1 at the end too,
com.mbwasi.funapp-1.apk
where would this be coming from?
Is this on the same phone? Are you sure you are uploading the exact same APK? ClassNotFoundException could mean that some class your Splash activity is using is not found, you might be missing some library.
Well I left it overnight, refreshed the market page for my App and now it not only shows as compatible with all my devices but also works when installed. So it was a Market issue. There was a tip in the other thread to unpublish and publish and I did that, no idea if it actually did anything though.

Navit Excepition:java.lang.ExceptionInInitializerError

While running the Navit code for car navigation, I am getting the following exception, i thought that navit library is not available. please any one help me.
E/AndroidRuntime( 365): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 365): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 365): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 365): at java.lang.Class.newInstance(Class.java:1472)
E/AndroidRuntime( 365): at android.app.Instrumentation.newActivity(Instrumentation.java:1097)
E/AndroidRuntime( 365): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
E/AndroidRuntime( 365): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
E/AndroidRuntime( 365): at android.app.ActivityThread.access$2100(ActivityThread.java:116)
E/AndroidRuntime( 365): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
E/AndroidRuntime( 365): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 365): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 365): at android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime( 365): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 365): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 365): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 365): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime( 365): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 365): Caused by: java.lang.UnsatisfiedLinkError: Library navit not found
E/AndroidRuntime( 365): at java.lang.Runtime.loadLibrary(Runtime.java:489)
E/AndroidRuntime( 365): at java.lang.System.loadLibrary(System.java:557)
i downloaded the Navit code from , navit svn.ttps://navit.svn.sourceforge.net/svnroot/navit/trunk/navit But unable to run the code.
i want to run this code in Eclipse for Android Project.
You need to download Android NDK
Create standalong tools for your ARCH
Cross compile to ARM
Run make apkg
This error is due to missing libnavit.so.
Put libnavit.so it in /data/local
Change System.LoadLibrary to System.Load("/data/local/libnavit.so");
make apkg
Install
This exception should go away.

Categories

Resources