Issue : Trying to register my Emulator (Google cloud messaging)? - android-emulator

I have downloaded some Google cloud messaging sample application. If I run my example application. unfortunately, gcm-client-demo has stopped. I got this kind of problem.
I have sender id, app key and server url.
compulsory I need to sig-in for google account for my emulator. Right now my emulator not
sign-in
why i am facing this problem please explain me..
logcat:
02-28 14:48:03.189: D/AndroidRuntime(976): Shutting down VM
02-28 14:48:03.189: W/dalvikvm(976): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
02-28 14:48:03.229: E/AndroidRuntime(976): FATAL EXCEPTION: main
02-28 14:48:03.229: E/AndroidRuntime(976): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.gcm.demo.app/com.google.android.gcm.demo.app.DemoActivity}: java.lang.UnsupportedOperationException: Device does not have package com.google.android.gsf
02-28 14:48:03.229: E/AndroidRuntime(976): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
02-28 14:48:03.229: E/AndroidRuntime(976): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
02-28 14:48:03.229: E/AndroidRuntime(976): at android.app.ActivityThread.access$600(ActivityThread.java:130)
02-28 14:48:03.229: E/AndroidRuntime(976): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
02-28 14:48:03.229: E/AndroidRuntime(976): at android.os.Handler.dispatchMessage(Handler.java:99)
02-28 14:48:03.229: E/AndroidRuntime(976): at android.os.Looper.loop(Looper.java:137)
02-28 14:48:03.229: E/AndroidRuntime(976): at android.app.ActivityThread.main(ActivityThread.java:4745)
02-28 14:48:03.229: E/AndroidRuntime(976): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 14:48:03.229: E/AndroidRuntime(976): at java.lang.reflect.Method.invoke(Method.java:511)
02-28 14:48:03.229: E/AndroidRuntime(976): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
02-28 14:48:03.229: E/AndroidRuntime(976): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
02-28 14:48:03.229: E/AndroidRuntime(976): at dalvik.system.NativeStart.main(Native Method)
02-28 14:48:03.229: E/AndroidRuntime(976): Caused by: java.lang.UnsupportedOperationException: Device does not have package com.google.android.gsf
02-28 14:48:03.229: E/AndroidRuntime(976): at com.google.android.gcm.GCMRegistrar.checkDevice(GCMRegistrar.java:98)
02-28 14:48:03.229: E/AndroidRuntime(976): at com.google.android.gcm.demo.app.DemoActivity.onCreate(DemoActivity.java:51)
02-28 14:48:03.229: E/AndroidRuntime(976): at android.app.Activity.performCreate(Activity.java:5008)
02-28 14:48:03.229: E/AndroidRuntime(976): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
02-28 14:48:03.229: E/AndroidRuntime(976): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
02-28 14:48:03.229: E/AndroidRuntime(976): ... 11 more
02-28 14:48:03.260: W/ActivityManager(372): Force finishing activity com.google.android.gcm.demo.app/.DemoActivity
02-28 14:48:03.279: W/WindowManager(372): Failure taking screenshot for (343x201) to layer 21010
02-28 14:48:03.719: I/Choreographer(372): Skipped 39 frames! The application may be doing too much work on its main thread.
02-28 14:48:03.809: W/ActivityManager(372): Activity pause timeout for ActivityRecord{4125ba80 com.google.android.gcm.demo.app/.DemoActivity}
02-28 14:48:04.718: I/Choreographer(930): Skipped 95 frames! The application may be doing too much work on its main thread.
02-28 14:48:05.369: I/ARMAssembler(36): generated scanline__00000077:03515104_00008001_00000000 [113 ipp] (134 ins) at [0x41407610:0x41407828] in 8278218 ns
02-28 14:48:06.488: I/ActivityManager(372): No longer want com.android.contacts (pid 544): hidden #16
02-28 14:48:16.499: W/ActivityManager(372): Activity destroy timeout for ActivityRecord{4125ba80 com.google.android.gcm.demo.app/.DemoActivity}
02-28 14:52:21.518: D/dalvikvm(456): GC_CONCURRENT freed 397K, 9% free 6557K/7175K, paused 32ms+13ms, total 125ms
02-28 14:53:03.318: I/Process(976): Sending signal. PID: 976 SIG: 9
02-28 14:53:03.378: I/ActivityManager(372): Process com.google.android.gcm.demo.app (pid 976) has died.
02-28 14:53:03.428: W/InputMethodManagerService(372): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#41317c60 attribute=null
02-28 14:53:17.979: E/ThrottleService(372): problem during onPollAlarm: java.lang.IllegalStateException: problem parsing stats: java.io.FileNotFoundException: /proc/net/xt_qtaguid/iface_stat_all: open failed: ENOENT (No such file or directory)
02-28 14:59:57.108: D/dalvikvm(456): GC_CONCURRENT freed 385K, 9% free 6555K/7175K, paused 17ms+9ms, total 98ms

It sounds as though your emulator does not have the Google API's installed, based on this error message:
Device does not have package com.google.android.gsf
You can read about the GCM client requirements in the Google GCM docs: http://developer.android.com/google/gcm/demo.html#requirements
The important part being this:
For the Android application:
Emulator (or device) running Android 2.2 with Google APIs.
The Google API project number of the account registered to use GCM.
So when you create your emulator make sure that the target has the Google API's installed. E.g.:
Google APIs (Google Inc.) - API Level 10

Related

How to resolve java.lang.NoClassDefFoundError errors in flutter?

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’.

Porting Android App to BB10 OS (BlackBerry)

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.

Instrumentation run: java.lang.Error with Class init failed in Constructor error

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

Does anyone understand the syntax of this? [closed]

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.

Android: Published App crashes with ClassNotFoundException

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?