I'm trying to run android application from react-native. I've tried standard application brought with "react-native init" and "Hello world" application from react-native github but I get this error stack on both emulator and device:
09-16 14:21:23.334 3441 3486 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
09-16 14:21:23.334 3441 3486 E AndroidRuntime: Process: com.deleteme, PID: 3441
09-16 14:21:23.334 3441 3486 E AndroidRuntime: java.lang.IllegalStateException: closed
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at okhttp3.internal.http.Http1xStream$FixedLengthSource.read(Http1xStream.java:374)
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at okio.Buffer.writeAll(Buffer.java:993)
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at okio.RealBufferedSource.readByteArray(RealBufferedSource.java:106)
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at okhttp3.ResponseBody.bytes(ResponseBody.java:128)
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at okhttp3.ResponseBody.string(ResponseBody.java:154)
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at com.facebook.react.devsupport.DevServerHelper$3.onResponse(DevServerHelper.java:301)
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126)
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
09-16 14:21:23.334 3441 3486 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
And on device itself application tries to start, but crashes with message "Unfortunately, deleteme has stopped". According to this post I've checked enableProguardInReleaseBuilds in android/app/build.gradle and it was "false" by default. How can I make it work?
Related
I built AOSP (android-8.1.0_r52) then flash to nexus 5x
BUT it doesn't support app with armeabi-v7a native library only.
E:\Project\JniApp\app\build\outputs\apk\debug>adb shell getprop ro.product.cpu.abi
arm64-v8a
E:\Project\JniApp\app\build\outputs\apk\debug>adb shell getprop ro.product.cpu.abilist
arm64-v8a,armeabi-v7a,armeabi
here is the error PathClassLoader doesn't find armeabi-v7a librarys
03-04 22:07:32.291 4600 4600 D AndroidRuntime: Shutting down VM
03-04 22:07:32.295 4600 4600 E AndroidRuntime: FATAL EXCEPTION: main
03-04 22:07:32.295 4600 4600 E AndroidRuntime: Process: com.example.jniapp, PID: 4600
03-04 22:07:32.295 4600 4600 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.jniapp-im9SAuaTFDrdrTwHyX9rKg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.jniapp-im9SAuaTFDrdrTwHyX9rKg==/lib/arm64, /system/lib64, /vendor/lib64]]] couldn't find "libnative-lib.so"
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1657)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at com.example.jniapp.MainActivity.<clinit>(MainActivity.java:14)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at java.lang.Class.newInstance(Native Method)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1174)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2864)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at android.app.ActivityThread.-wrap11(Unknown Source:0)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1597)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6506)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
03-04 22:07:32.295 4600 4600 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
03-04 22:07:32.300 839 1853 W ActivityManager: Force finishing activity com.example.jniapp/.MainActivity
03-04 22:07:32.306 839 924 I ActivityManager: Showing crash dialog for package com.example.jniapp u0
03-04 22:07:32.327 839 2093 I OpenGLRenderer: Initialized EGL, version 1.4
03-04 22:07:32.327 839 2093 D OpenGLRenderer: Swap behavior 2
03-04 22:07:32.544 580 793 D audio_hw_primary: disable_audio_route: usecase(1) reset and update mixer path: low-latency-playback
03-04 22:07:32.559 580 793 D audio_hw_primary: disable_snd_device: snd_device(95: vi-feedback)
03-04 22:07:32.560 580 793 D audio_hw_primary: disable_audio_route: usecase(24) reset and update mixer path: spkr-vi-record
03-04 22:07:32.802 839 923 W ActivityManager: Activity pause timeout for ActivityRecord{6d9fbd u0 com.example.jniapp/.MainActivity t9 f}
I developed an application that through some requests by AXIOS to certain apis it presents data, the app is very simple, I have checked all links and they all start with HTTP or HTTPS .. The application works perfectly if I generate the apk in DEBUG mode , but if I create an apk release the error comes ...
it is worth mentioning that this is a project ejected from the expo
this is the logcat log when i open the app release:
04-20 23:11:18.022 10873 10896 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
04-20 23:11:18.022 10873 10896 E AndroidRuntime: Process: com.radarcorona, PID: 10873
04-20 23:11:18.022 10873 10896 E AndroidRuntime: java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was found
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at okhttp3.HttpUrl$Builder.parse(HttpUrl.java:1333)
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at okhttp3.HttpUrl.get(HttpUrl.java:916)
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at okhttp3.Request$Builder.url(Request.java:165)
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at expo.modules.updates.loader.FileDownloader.addHeadersToManifestUrl(FileDownloader.java:190)
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at expo.modules.updates.loader.FileDownloader.downloadManifest(FileDownloader.java:79)
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at expo.modules.updates.loader.RemoteLoader.start(RemoteLoader.java:56)
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at expo.modules.updates.UpdatesController.lambda$start$0$UpdatesController(UpdatesController.java:307)
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at expo.modules.updates.-$$Lambda$UpdatesController$cVwvsx9XXcX6YuWbf7IvrVkJAiA.run(Unknown Source:6)
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)04-20 23:11:18.022 10873 10896 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
04-20 23:11:18.022 10873 10896 E AndroidRuntime: at java.lang.Thread.run(Thread.java:919)
04-20 23:11:18.024 10873 10894 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
04-20 23:11:18.036 2039 2882 W ActivityTaskManager: Force finishing activity com.radarcorona/.MainActivity
react-native: 0.61.5
I believe I found the solution to this error.
Removing expo-updates. As #fabiocosta88 mentioned on GitHub issue, the issue raises from expo-updates. Since I wasn't actually using the module in my project, I followed the guide to remove the module in all files it was defined. Here is the guide.
If uninstallation is not an option I believe that defining the EXPO_UPDATE_URL and EXPO_SDK_VERSION in the AndroidManifest.xml might solve the issue. I believe this guide defines how to get the EXPO_UPDATE_URL.
Setup wizard is getting crashed after the "set up as a new " screen when we connect to wifi it says:
checking for updates
and then Setup wizard crashes.
Android version: 7.1.2 GMS vesrion integrated in device:[7.1_r5]
We already have the framework changes added in our code but still we are getting the error
https://android.googlesource.com/platform/frameworks/base/+/b3ad567%5E%21/#F1
Logs:
09-19 17:39:19.360 9982 9982 E AndroidRuntime: FATAL EXCEPTION: main
09-19 17:39:19.360 9982 9982 E AndroidRuntime: Process: com.google.android.setupwizard, PID: 9982
09-19 17:39:19.360 9982 9982 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.google.android.setupwizard/com.google.android.setupwizard.account.AccountSetupWrapper}: **java.lang.SecurityException: Permission Denial: updateLockTaskPackages() from pid=9982, uid=10028 requires android.permission.UPDATE_LOCK_TASK_PACKAGES**
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityThread.-wrap12(ActivityThread.java)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6121)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: Caused by: java.lang.SecurityException: Permission Denial: updateLockTaskPackages() from pid=9982, uid=10028 requires android.permission.UPDATE_LOCK_TASK_PACKAGES
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1684)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1637)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityManagerProxy.updateLockTaskPackages(ActivityManagerNative.java:6774)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at
I am not sure exactly the reason why this happens, maybe your OpenGMS is not properly installed...
The setupwizard is install under "/system/priv-app", so you might change the permission level of android.permission.UPDATE_LOCK_TASK_PACKAGES in frameworks/base/core/res/AndroidManifest.xml as followings
android:protectionLevel="signature|setup|privileged"
This works in my case....
Able to fix the issue.
There seems to be a two setupwizard which are causing the issue
Add below piece of code in Android.mk for Setupwizard delivered as GMS application
LOCAL_OVERRIDES_PACKAGES := Provision Setup_Wizard
My NDK game works well in Debug mode, but crashes in release with the following log on Nexus 7:
E dalvikvm: dlopen("/data/app-lib/com.js.pathoflight-1/libPathOfLight.so") failed: dlopen failed: cannot locate symbol "__gnu_thumb1_case_uqi" referenced by
"libPathOfLight.so"...
W dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/js /pathoflight/JSNativeActivity;
W dalvikvm: Class init failed in newInstance call (Lcom/js/pathoflight/JSNativeActivity;)
D AndroidRuntime: Shutting down VM
W dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41b01700)
E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__gnu_thumb1_case_uqi" referenced by "libPathOfLight.so"...
E AndroidRuntime: at java.lang.Runtime.loadLibrary(Runtime.java:361)
E AndroidRuntime: at java.lang.System.loadLibrary(System.java:525)
E AndroidRuntime: at com.js.pathoflight.JSNativeActivity.<clinit>(JSNativeActivity.java:59)
E AndroidRuntime: at java.lang.Class.newInstanceImpl(Native Method)
E AndroidRuntime: at java.lang.Class.newInstance(Class.java:1130)
E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
E AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:141)
E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
E AndroidRuntime: at android.os.Looper.loop(Looper.java:137)
E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5103)
E AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:525)
E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
W ActivityManager: Force finishing activity com.js.pathoflight/.JSNativeActivity
I'll appreciate any suggestion.
While removing different parts of the code I found that the issue was in a 3rd party library I used.
I changed its usage from "gnustl_static" version (.a) to "gnustl_shared" (.so) one and the problem disappeared!
I am developing an Android app for 4.1.2 on Netbeans 7.3 using the NBAndroid plugin. I downloaded and compiled the JExcelAPI, and pulled the jxl.jar file into my "libs" folder. My app compiles fine and runs fine, until I try to instantiate a Label object. Then the program gives that irritating "Unforunately, FinanceApp has stopped." When I check the LogCat, it tells me that the error was primarily caused by a NoClassDefFoundError pertaining to jxl.write.Label (as you can see in the snippet below). I don't know what the problem is. I have looked around and I have made sure that the folder I put the jxl.jar file in was named "libs" not "lib." I've updated everything, from the Android SDK to Netbeans to jxl.jar (by re-compiling it). The error doesn't change.
Thanks in advance for the help!
-John
The LogCat snippet:
06-10 12:11:44.037 10704 10704 E AndroidRuntime: FATAL EXCEPTION: main
06-10 12:11:44.037 10704 10704 E AndroidRuntime: java.lang.IllegalStateException: Could not execute method of the activity
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at android.view.View$1.onClick(View.java:3598)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at android.view.View.performClick(View.java:4091)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at android.view.View$PerformClick.run(View.java:17036)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:615)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:92)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at android.os.Looper.loop(Looper.java:137)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5021)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:511)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:511)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at android.view.View$1.onClick(View.java:3593)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: ... 11 more
06-10 12:11:44.037 10704 10704 E AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: jxl.write.Label
06-10 12:11:44.037 10704 10704 E AndroidRuntime: at com.<package-name>.financeapp.TransactionActivity.addTransaction(TransactionActivity.java:86)
06-10 12:11:44.037 10704 10704 E AndroidRuntime: ... 14 more