When I run the app from flutter to the Android simulator, the following error is returned, and it does not run, I don't know what the problem is, please advise on the error.
Launching lib/main.dart on Android SDK built for arm64 in debug mode...
lib/main.dart:1
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:57149/NUW2Tq4P_Hg=/ws
E/AndroidRuntime( 8510): FATAL EXCEPTION: main
E/AndroidRuntime( 8510): Process: com.example.qnsdk_example, PID: 8510
E/AndroidRuntime( 8510): java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/localbroadcastmanager/content/LocalBroadcastManager;
E/AndroidRuntime( 8510): at com.yolanda.health.qnblesdk.out.QNBleApi.setBleDeviceDiscoveryListener(QNBleApi.java:787)
E/AndroidRuntime( 8510): at com.example.qnsdk.QNSdkPlugin.setBleDeviceDiscoveryListener(QNSdkPlugin.kt:146)
E/AndroidRuntime( 8510): at com.example.qnsdk.QNSdkPlugin.onMethodCall(QNSdkPlugin.kt:82)
E/AndroidRuntime( 8510): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/AndroidRuntime( 8510): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:178)
E/AndroidRuntime( 8510): at io.flutter.embedding.engine.dart.DartMessenger.lambda$handleMessageFromDart$0$DartMessenger(DartMessenger.java:206)
E/AndroidRuntime( 8510): at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$R4HPk6oFVb-i-YR_PN9YE6kqx1I.run(Unknown Source:12)
E/AndroidRuntime( 8510): at android.os.Handler.handleCallback(Handler.java:883)
E/AndroidRuntime( 8510): at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime( 8510): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime( 8510): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime( 8510): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 8510): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime( 8510): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime( 8510): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.localbroadcastmanager.content.LocalBroadcastManager" on path: DexPathList[[zip file "/data/app/com.example.qnsdk_example-cDdo9nfJTxqNGC_B2Gxa2g==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.qnsdk_example-cDdo9nfJTxqNGC_B2Gxa2g==/lib/arm64, /data/app/com.example.qnsdk_example-cDdo9nfJTxqNGC_B2Gxa2g==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]
E/AndroidRuntime( 8510): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
E/AndroidRuntime( 8510): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime( 8510): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime( 8510): ... 14 more
I/flutter ( 8510): initSDK 1108
I/Process ( 8510): Sending signal. PID: 8510 SIG: 9
Lost connection to device.
Exited (sigterm)
and in the sdk manager
android sdk command-line tools (latest)
I followed it because I had to check it, but the error does not go away and continues.
Try this:
Open Tools > SDK Manager
choose Appearance & Behavior > System Settings > Android SDK
Select SDK Tools
Check Android SDK Command-line tools and click ‘apply’.
I am trying to port a native Android app to BB10 OS (BlackBerry). I was able to install the app but when I launch it, I see this error:
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to create application com.example.MyApplication: java.lang.SecurityException: Failed to open /dev/urandom for writing
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4454)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5116)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.SecurityException: Failed to open /dev/urandom for writing
at o.dD$if.Ë‹(:279)
at o.dD$if.engineSetSeed(:215)
at java.security.SecureRandom.setSeed(SecureRandom.java:243)
at java.security.SecureRandom.setSeed(SecureRandom.java:258)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at o.ff$Õ™.<clinit>(Unknown Source)
at o.dA.ËŠ(:285)
at o.dA.<init>(:99)
at o.dA.ËŠ(:151)
at com.example.MyApplication.ͺ(:182)
at com.example.MyApplication.onCreate(:66)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4451)
... 10 more
Caused by: java.io.FileNotFoundException: /dev/urandom: open failed: EACCES (Permission denied)
at libcore.io.IoBridge.open(IoBridge.java:409)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
at o.dD$if.Ë‹(:277)
... 23 more
Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:393)
... 26 more
W/ActivityManager(6766745): Force finishing activity com.example.android.agent/com.example.agent.activities.LaunchActivity
E/OrientationUtil(6766745): Unable to read sensor data. errno 11
D/dalvikvm(20689057): GC_CONCURRENT freed 307K, 5% free 10097K/10576K, paused 1ms+1ms, total 48ms
Any insights into addressing this issue is highly appreciated.
I wrote an instrumentation test:
Exactly it shows an Verify error:
public WebViewActivityTest() {
super(WebViewActivity.class);
Constructor used:
W/dalvikvm( 858): Class init failed in Constructor.constructNative (Lcom/amazon/webviewapp/test/WebViewActivityTest;)
D/AndroidRuntime( 858): Shutting down VM
W/dalvikvm( 858): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
E/AndroidRuntime( 858): FATAL EXCEPTION: main
E/AndroidRuntime( 858): java.lang.VerifyError: com/amazon/webviewapp/test/WebViewActivityTest
E/AndroidRuntime( 858): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 858): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
E/AndroidRuntime( 858): at junit.framework.TestSuite.createTest(TestSuite.java:61)
E/AndroidRuntime( 858): at junit.framework.TestSuite.addTestMethod(TestSuite.java:294)
E/AndroidRuntime( 858): at junit.framework.TestSuite.addTestsFromTestCase(TestSuite.java:150)
E/AndroidRuntime( 858): at junit.framework.TestSuite.<init>(TestSuite.java:129)
E/AndroidRuntime( 858): at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:118)
E/AndroidRuntime( 858): at android.test.AndroidTestRunner.getTest(AndroidTestRunner.java:148)
E/AndroidRuntime( 858): at android.test.AndroidTestRunner.setTestClassName(AndroidTestRunner.java:56)
E/AndroidRuntime( 858): at android.test.suitebuilder.TestSuiteBuilder.addTestClassByName(TestSuiteBuilder.java:80)
E/AndroidRuntime( 858): at android.test.InstrumentationTestRunner.parseTestClass(InstrumentationTestRunner.java:444)
E/AndroidRuntime( 858): at android.test.InstrumentationTestRunner.parseTestClasses(InstrumentationTestRunner.java:425)
E/AndroidRuntime( 858): at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:370)
E/AndroidRuntime( 858): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4382)
E/AndroidRuntime( 858): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
E/AndroidRuntime( 858): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
E/AndroidRuntime( 858): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 858): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 858): at android.app.ActivityThread.main(ActivityThread.java:5039)
E/AndroidRuntime( 858): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 858): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 858): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime( 858): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime( 858): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 285): Error in app com.amazon.webviewapp running instrumentation ComponentInfo{com.amazon.webviewapp.test/android.test.InstrumentationTestRunner}:
W/ActivityManager( 285): java.lang.VerifyError
W/ActivityManager( 285): java.lang.VerifyError: com/amazon/webviewapp/test/WebViewActivityTest
D/AndroidRuntime( 848): Shutting down VM
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
05-18 03:36:42.250: E/Trace(3525): error opening trace file: No such file or directory (2)
05-18 03:36:42.640: D/AndroidRuntime(3525): Shutting down VM
05-18 03:36:42.640: W/dalvikvm(3525): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
05-18 03:36:42.732: E/AndroidRuntime(3525): FATAL EXCEPTION: main
05-18 03:36:42.732: E/AndroidRuntime(3525): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
05-18 03:36:42.732: E/AndroidRuntime(3525): at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
05-18 03:36:42.732: E/AndroidRuntime(3525): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
05-18 03:36:42.732: E/AndroidRuntime(3525): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
05-18 03:36:42.732: E/AndroidRuntime(3525): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
05-18 03:36:42.732: E/AndroidRuntime(3525): at android.os.Handler.dispatchMessage(Handler.java:99)
05-18 03:36:42.732: E/AndroidRuntime(3525): at android.os.Looper.loop(Looper.java:137)
05-18 03:36:42.732: E/AndroidRuntime(3525): at android.app.ActivityThread.main(ActivityThread.java:5041)
05-18 03:36:42.732: E/AndroidRuntime(3525): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 03:36:42.732: E/AndroidRuntime(3525): at java.lang.reflect.Method.invoke(Method.java:511)
05-18 03:36:42.732: E/AndroidRuntime(3525): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-18 03:36:42.732: E/AndroidRuntime(3525): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-18 03:36:42.732: E/AndroidRuntime(3525): at dalvik.system.NativeStart.main(Native Method)
05-18 03:36:42.732: E/AndroidRuntime(3525): Caused by: java.lang.NullPointerException
05-18 03:36:42.732: E/AndroidRuntime(3525): at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:379)
05-18 03:36:42.732: E/AndroidRuntime(3525): at android.app.LoadedApk.getClassLoader(LoadedApk.java:322)
05-18 03:36:42.732: E/AndroidRuntime(3525): at android.app.LoadedApk.makeApplication(LoadedApk.java:496)
05-18 03:36:42.732: E/AndroidRuntime(3525): ... 11 more
05-18 03:36:56.010: D/gralloc_goldfish(3558): Emulator without GPU emulation detected.
05-18 03:47:25.183: I/Choreographer(3558): Skipped 45 frames! The application may be doing too much work on its main thread.
05-18 03:47:39.080: D/gralloc_goldfish(3613): Emulator without GPU emulation detected.
05-18 03:47:41.770: D/dalvikvm(3613): GC_CONCURRENT freed 84K, 7% free 2781K/2988K, paused 72ms+10ms, total 196ms
05-18 03:47:41.770: D/dalvikvm(3613): WAIT_FOR_CONCURRENT_GC blocked 55ms
05-18 03:47:45.579: D/dalvikvm(3613): GC_CONCURRENT freed 100K, 7% free 3083K/3300K, paused 5ms+20ms, total 226ms
05-18 03:47:53.329: I/Choreographer(3613): Skipped 111 frames! The application may be doing too much work on its main thread.
I know this is the second time I'm posting error messages, but please bear with me as I will eventually fully understand how to decipher these logs. But could someone help me understand why my log began with errors and then began to say that my emulation started to work?
What you've posted is a stack trace. It's a trace of what's happened most recently, and tracing back to what happened to get you there.
You need to read this in reverse. What happens at the top (the first line of what you posted) is what happened most recently.
Think of it like this:
I feel pain in my finger.
Just before that, my finger touched a hot burner.
Just before that, my hand stopped moving.
Just before that, my hand was moving down toward the burner.
Just before that, my hand was over the stove.
Just before that, my hand was just in front of the stove.
Just before that, my hand was near the stove.
Just before that, my hand was near my body.
Just before that, my hand was by my side.
Your problem has nothing to do with the fact that the emulator started running, your problem is this line:
Caused by: java.lang.NullPointerException at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:379)
This means that somewhere in your code (as the error states: on line 379 if LoadedApk is you class) you are trying to access something that wasn't created first or it's creation failed and those it holds Null instead of an actual value or an Object.
I have just published my first app today but for some reason when I use the published version I keep getting a ClassNotFoundException error when it starts up. It works fine when I test it in debug mode on my phone so I'm not sure whats causing this.
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.androidProjects.personal/com.androidProjects.personal.GAAClubFinderActivity}: java.lang.ClassNotFoundException: com.androidProjects.personal.GAAClubFinderActivity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2141)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2260)
at android.app.ActivityThread.access$600(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:5045)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.androidProjects.personal.GAAClubFinderActivity
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1039)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2132)
... 11 more
Any Ideas?