Reputation: 35
IBM Worklight v6.0
Using the Worklight Liberty Profile Standalone server with Derby database
Following the infocenter instruction to create the app center apk package.
I have tried to use the installer and also Run As Android Application in the Android emulator. The application fails to start with this error in the emulator "Unfortunately, IBM App Center has stopped".
And the following errors are shown in LogCat.
06-24 00:34:56.640: E/AndroidRuntime(999): FATAL EXCEPTION: main 06-24 00:34:56.640: E/AndroidRuntime(999): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ibm.appcenter/com.ibm.appcenter.AppCenter}: java.lang.UnsupportedOperationException: Device does not have package com.google.android.gsf 06-24 00:34:56.640: E/AndroidRuntime(999): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059) 06-24 00:34:56.640: E/AndroidRuntime(999): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 06-24 00:34:56.640: E/AndroidRuntime(999): at android.app.ActivityThread.access$600(ActivityThread.java:130) 06-24 00:34:56.640: E/AndroidRuntime(999): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 06-24 00:34:56.640: E/AndroidRuntime(999): at android.os.Handler.dispatchMessage(Handler.java:99) 06-24 00:34:56.640: E/AndroidRuntime(999): at android.os.Looper.loop(Looper.java:137) 06-24 00:34:56.640: E/AndroidRuntime(999): at android.app.ActivityThread.main(ActivityThread.java:4745) 06-24 00:34:56.640: E/AndroidRuntime(999): at java.lang.reflect.Method.invokeNative(Native Method) 06-24 00:34:56.640: E/AndroidRuntime(999): at java.lang.reflect.Method.invoke(Method.java:511) 06-24 00:34:56.640: E/AndroidRuntime(999): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 06-24 00:34:56.640: E/AndroidRuntime(999): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 06-24 00:34:56.640: E/AndroidRuntime(999): at dalvik.system.NativeStart.main(Native Method) 06-24 00:34:56.640: E/AndroidRuntime(999): Caused by: java.lang.UnsupportedOperationException: Device does not have package com.google.android.gsf 06-24 00:34:56.640: E/AndroidRuntime(999): at com.google.android.gcm.GCMRegistrar.checkDevice(GCMRegistrar.java:96) 06-24 00:34:56.640: E/AndroidRuntime(999): at com.ibm.mobile.application.main.AbstractAppCenter.onCreate(AbstractAppCenter.java:66) 06-24 00:34:56.640: E/AndroidRuntime(999): at com.ibm.appcenter.AppCenter.onCreate(AppCenter.java:30) 06-24 00:34:56.640: E/AndroidRuntime(999): at android.app.Activity.performCreate(Activity.java:5008) 06-24 00:34:56.640: E/AndroidRuntime(999): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 06-24 00:34:56.640: E/AndroidRuntime(999): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) 06-24 00:34:56.640: E/AndroidRuntime(999): ... 11 more
Upvotes: 0
Views: 527
Reputation: 3
I can across the same problem running the IBM App Center client app on an Intel x86 based emulator, and had to switch to using one with Google APIs, or a device, say Nexus 7. A quick Google search turned up the following post, which mentions that not all devices include the Google APIs (e.g. Amazon Kindle), so this App Center problem could still exist for some users. The post also has a recommendation to catch the exception:
http://www.marvinlabs.com/2013/01/22/avoiding-crashes-when-using-gcm-in-your-android-application/
Upvotes: 0
Reputation: 35
I changed the emulator's Target from "Android 4.1.2" to "Google APIs (Google Inc) - API 16". Restart the emulator. The AppCenter can start.
However, I got the error on CordovaWebView: TIMEOUT ERROR! which can be solved by this post -
Giving Time out error while opening worklight hybrid app in android emulator
Upvotes: 0
Reputation: 44516
Please see a possible solution here: com.google.android.gsf package couldn't be found
Seems to be related to not using the correct settings for the Android emulator.
Upvotes: 0