IBM Worklight v6.0
使用带有Derby数据库的Worklight Liberty Profile独立服务器
按照infocenter指令创建应用程序中心apk包。
我试图在Android模拟器中使用安装程序和Run As Android Application。应用程序无法在模拟器中以此错误启动“不幸的是,IBM App Center已停止”
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
答案 0 :(得分:0)
请在此处查看可能的解决方案:com.google.android.gsf package couldn't be found
似乎与不使用Android模拟器的正确设置有关。
答案 1 :(得分:0)
我将模拟器的目标从“Android 4.1.2”更改为“Google API(Google Inc) - API 16”。重新启动模拟器。 AppCenter可以启动。
但是,我在CordovaWebView上遇到错误:TIMEOUT ERROR!这个帖子可以解决 -
Giving Time out error while opening worklight hybrid app in android emulator
答案 2 :(得分:0)
我可以解决在基于英特尔x86的仿真器上运行IBM App Center客户端应用程序时遇到的同样问题,并且不得不切换到使用带有Google API或设备的应用程序,比如说Nexus 7.快速谷歌搜索发现以下内容post,其中提到并非所有设备都包含Google API(例如Amazon Kindle),因此某些用户仍可能存在此App Center问题。该帖子还建议捕获例外:
http://www.marvinlabs.com/2013/01/22/avoiding-crashes-when-using-gcm-in-your-android-application/