IBM Worklight - Android SDK - 模拟器部署问题 - 不幸的是,“应用程序”已停止
Posted
技术标签:
【中文标题】IBM Worklight - Android SDK - 模拟器部署问题 - 不幸的是,“应用程序”已停止【英文标题】:IBM Worklight - Android SDK - Emulator deployment issue - Unfortunately, 'app' has stopped 【发布时间】:2013-05-28 04:41:39 【问题描述】:我使用的是 Mac 10.8.3、Eclipse Juno 和最新的 android SDK 22.0.0、IBM Worklight 版本 5.0.6.1。
我在 Worklight 中使用 Dojo Mobile 和 html5/CSS3 制作了一个小型移动应用程序,但很难在 Android 模拟器上部署,尽管它在 Xcode 中运行良好。
这是 logcat,从 Java 端看起来有些奇怪,因此得到了运行时异常。
05-28 09:56:45.197: E/AndroidRuntime(562): FATAL EXCEPTION: main
05-28 09:56:45.197: E/AndroidRuntime(562): java.lang.RuntimeException: Unable to instantiate activity ComponentInfocom.TD/com.TD.TD: java.lang.ClassNotFoundException: com.TD.TD
05-28 09:56:45.197: E/AndroidRuntime(562): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1879)
05-28 09:56:45.197: E/AndroidRuntime(562): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
05-28 09:56:45.197: E/AndroidRuntime(562): at android.app.ActivityThread.access$600(ActivityThread.java:122)
05-28 09:56:45.197: E/AndroidRuntime(562): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
05-28 09:56:45.197: E/AndroidRuntime(562): at android.os.Handler.dispatchMessage(Handler.java:99)
05-28 09:56:45.197: E/AndroidRuntime(562): at android.os.Looper.loop(Looper.java:137)
05-28 09:56:45.197: E/AndroidRuntime(562): at android.app.ActivityThread.main(ActivityThread.java:4340)
05-28 09:56:45.197: E/AndroidRuntime(562): at java.lang.reflect.Method.invokeNative(Native Method)
05-28 09:56:45.197: E/AndroidRuntime(562): at java.lang.reflect.Method.invoke(Method.java:511)
05-28 09:56:45.197: E/AndroidRuntime(562): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-28 09:56:45.197: E/AndroidRuntime(562): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-28 09:56:45.197: E/AndroidRuntime(562): at dalvik.system.NativeStart.main(Native Method)
05-28 09:56:45.197: E/AndroidRuntime(562): Caused by: java.lang.ClassNotFoundException: com.TD.TD
05-28 09:56:45.197: E/AndroidRuntime(562): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
05-28 09:56:45.197: E/AndroidRuntime(562): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-28 09:56:45.197: E/AndroidRuntime(562): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-28 09:56:45.197: E/AndroidRuntime(562): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
05-28 09:56:45.197: E/AndroidRuntime(562): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1870)
05-28 09:56:45.197: E/AndroidRuntime(562): ... 11 more
Idan,尝试了相同的刻度但没有帮助,下面是 logcat 输出。
05-28 10:35:49.564: E/PushClient(1895): [a] MCC is same
05-28 10:35:49.834: E/Samsung TTS(5063): onLoadLanguage() - lang : eng, country : USA, variant :
05-28 10:35:49.834: E/Samsung TTS(5063): onIsLanguageAvailable() - lang : eng, country : USA, variant : , iResult : 1
05-28 10:35:49.839: E/Samsung TTS(5063): onLoadLanguage() - LANG_COUNTRY_AVAILABLE
05-28 10:35:49.844: E/Samsung TTS(5063): onLoadLanguage() - lang : eng, country : USA, variant : f01
05-28 10:35:49.999: E/Samsung TTS(5063): onCreate() - Samsung TTS package (released - 2012.06.14)
05-28 10:35:49.999: E/(5063): Samsung TTS Engine - initialize() : Samsung TTS Engine (released - 2012.07.11)
05-28 10:35:49.999: E/(5063): Samsung TTS Engine - initialize() : ro.product.manufacturer - samsung
05-28 10:35:52.429: E/PushClient(1895): [a] MCC is same
05-28 10:35:52.739: E/PushClient(1895): [a] MCC is same
05-28 10:35:53.399: E/SensorManager(5281): thread start
05-28 10:35:54.104: E/PushClient(1895): [a] MCC is same
05-28 10:35:57.729: E/PushClient(1895): [a] MCC is same
05-28 10:35:57.914: E/PushClient(1895): [a] MCC is same
05-28 10:35:59.454: E/PushClient(1895): [a] MCC is same
05-28 10:36:02.824: E/PowerManagerService(2008): WakeLock : binderDied()
05-28 10:36:02.824: E/PowerManagerService(2008): WakeLock : binderDied()
05-28 10:36:02.824: E/PowerManagerService(2008): WakeLock : binderDied()
05-28 10:36:08.074: E/PushClient(1895): [a] MCC is same
05-28 10:36:08.474: E/PushClient(1895): [a] MCC is same
05-28 10:36:09.364: E/PushClient(1895): [a] MCC is same
05-28 10:36:10.194: E/PowerManagerService(2008): WakeLock : binderDied()
05-28 10:36:11.619: E/MTPPlaObsrvr(22311): On change is called.false
05-28 10:36:11.619: E/MTPPlaObsrvr(22311): URI of the playlistcontent://media/external/audio/playlists
05-28 10:36:11.619: E/MTPPlaObsrvr(22311): Content resolver is not null
05-28 10:36:11.639: E/MTPPlaObsrvr(22311): Count1mCount1
05-28 10:36:11.639: E/MTPPlaObsrvr(22311): Neither deleted nor added. Could be rename
05-28 10:36:11.639: E/MTPPlaObsrvr(22311): It is not renamed
05-28 10:36:12.299: E/MetadataRetrieverClient(1733): setDataSource fd=45, offset=0, length=576460752303423487
05-28 10:36:12.299: E/MetadataRetrieverClient(1733): calculated length = 17294
05-28 10:36:15.789: E/SensorManager(6762): thread start
05-28 10:36:16.614: E/PushClient(1895): [a] MCC is same
05-28 10:36:16.929: E/PushClient(1895): [a] MCC is same
05-28 10:36:18.584: E/PushClient(1895): [a] MCC is same
05-28 10:36:18.719: E/Watchdog(2008): !@Sync 2284
05-28 10:36:20.699: E/MtpService(22311): In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-28 10:36:20.704: E/MtpService(22311): battPlugged Type : 2
05-28 10:36:23.319: E/a(7151): Metric [API Handler - SubscribePushNotification (mobile)] Value [984] (ms)
05-28 10:36:25.534: E/MTPPlaObsrvr(22311): On change is called.false
05-28 10:36:25.534: E/MTPPlaObsrvr(22311): URI of the playlistcontent://media/external/audio/playlists
05-28 10:36:25.534: E/MTPPlaObsrvr(22311): Content resolver is not null
05-28 10:36:25.599: E/MTPPlaObsrvr(22311): Count1mCount1
05-28 10:36:25.599: E/MTPPlaObsrvr(22311): Neither deleted nor added. Could be rename
05-28 10:36:25.599: E/MTPPlaObsrvr(22311): It is not renamed
05-28 10:36:25.774: E/MetadataRetrieverClient(1733): setDataSource fd=45, offset=0, length=576460752303423487
05-28 10:36:25.774: E/MetadataRetrieverClient(1733): calculated length = 17294
05-28 10:36:26.964: E/a(7244): Metric [API Handler - SubscribePushNotification (mobile)] Value [951] (ms)
05-28 10:36:26.969: E/a(7244): Metric [API Handler - SubscribePushNotification (mobile)] Value [834] (ms)
05-28 10:36:30.169: E/WifiP2pStateTracker(2008): getNetworkInfo : NetworkInfo: type: wifi_p2p[], state: UNKNOWN/IDLE, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: false
05-28 10:36:30.374: E/PushClient(1895): [a] MCC is same
05-28 10:36:30.704: E/PushClient(1895): [a] MCC is same
05-28 10:36:31.329: E/WifiP2pStateTracker(2008): getNetworkInfo : NetworkInfo: type: wifi_p2p[], state: UNKNOWN/IDLE, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: false
05-28 10:36:31.344: E/WifiP2pStateTracker(2008): getNetworkInfo : NetworkInfo: type: wifi_p2p[], state: UNKNOWN/IDLE, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: false
05-28 10:36:31.469: E/PushClient(1895): [a] MCC is same
05-28 10:36:35.834: E/PushClient(1895): [a] MCC is same
05-28 10:36:36.139: E/PushClient(1895): [a] MCC is same
05-28 10:36:39.624: E/MTPPlaObsrvr(22311): On change is called.false
05-28 10:36:39.624: E/MTPPlaObsrvr(22311): URI of the playlistcontent://media/external/audio/playlists
05-28 10:36:39.629: E/MTPPlaObsrvr(22311): Content resolver is not null
05-28 10:36:39.709: E/MTPPlaObsrvr(22311): Count1mCount1
05-28 10:36:39.709: E/MTPPlaObsrvr(22311): Neither deleted nor added. Could be rename
05-28 10:36:39.709: E/MTPPlaObsrvr(22311): It is not renamed
05-28 10:36:39.884: E/DBG_FMMDM(7678): Warning!!! [v1_1211_2_1][Line:590][xdbLawmoSetRegistration] java.lang.NullPointerException
05-28 10:36:40.119: E/MetadataRetrieverClient(1733): setDataSource fd=45, offset=0, length=576460752303423487
05-28 10:36:40.119: E/MetadataRetrieverClient(1733): calculated length = 17294
05-28 10:36:44.719: E/PushClient(1895): [a] MCC is same
05-28 10:36:48.629: E/PushClient(1895): [a] MCC is same
05-28 10:36:48.719: E/Watchdog(2008): !@Sync 2285
05-28 10:36:49.049: E/PushClient(1895): [a] MCC is same
05-28 10:36:53.099: E/MTPPlaObsrvr(22311): On change is called.false
05-28 10:36:53.099: E/MTPPlaObsrvr(22311): URI of the playlistcontent://media/external/audio/playlists
05-28 10:36:53.099: E/MTPPlaObsrvr(22311): Content resolver is not null
05-28 10:36:53.109: E/MTPPlaObsrvr(22311): Count1mCount1
05-28 10:36:53.109: E/MTPPlaObsrvr(22311): Neither deleted nor added. Could be rename
05-28 10:36:53.109: E/MTPPlaObsrvr(22311): It is not renamed
05-28 10:36:53.329: E/MetadataRetrieverClient(1733): setDataSource fd=45, offset=0, length=576460752303423487
05-28 10:36:53.329: E/MetadataRetrieverClient(1733): calculated length = 17294
05-28 10:36:53.519: E/SensorManager(7854): thread start
05-28 10:37:00.844: E/MtpService(22311): In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-28 10:37:00.844: E/MtpService(22311): battPlugged Type : 2
05-28 10:37:06.579: E/MTPPlaObsrvr(22311): On change is called.false
05-28 10:37:06.579: E/MTPPlaObsrvr(22311): URI of the playlistcontent://media/external/audio/playlists
05-28 10:37:06.579: E/MTPPlaObsrvr(22311): Content resolver is not null
05-28 10:37:06.699: E/PowerManagerService(2008): WakeLock : binderDied()
05-28 10:37:06.764: E/MTPPlaObsrvr(22311): Count1mCount1
05-28 10:37:06.764: E/MTPPlaObsrvr(22311): Neither deleted nor added. Could be rename
05-28 10:37:06.764: E/MTPPlaObsrvr(22311): It is not renamed
05-28 10:37:06.794: E/MetadataRetrieverClient(1733): setDataSource fd=45, offset=0, length=576460752303423487
05-28 10:37:06.794: E/MetadataRetrieverClient(1733): calculated length = 17294
05-28 10:37:06.824: E/MediaScannerService(8051): Exception in handleMessage
05-28 10:37:06.824: E/MediaScannerService(8051): android.os.DeadObjectException
05-28 10:37:06.824: E/MediaScannerService(8051): at android.os.BinderProxy.transact(Native Method)
05-28 10:37:06.824: E/MediaScannerService(8051): at android.media.IMediaScannerListener$Stub$Proxy.scanCompleted(IMediaScannerListener.java:100)
05-28 10:37:06.824: E/MediaScannerService(8051): at com.android.providers.media.MediaScannerService$ServiceHandler.handleMessage(MediaScannerService.java:282)
05-28 10:37:06.824: E/MediaScannerService(8051): at android.os.Handler.dispatchMessage(Handler.java:99)
05-28 10:37:06.824: E/MediaScannerService(8051): at android.os.Looper.loop(Looper.java:137)
05-28 10:37:06.824: E/MediaScannerService(8051): at com.android.providers.media.MediaScannerService.run(MediaScannerService.java:224)
05-28 10:37:06.824: E/MediaScannerService(8051): at java.lang.Thread.run(Thread.java:856)
05-28 10:37:13.299: E/PowerManagerService(2008): WakeLock : binderDied()
05-28 10:37:13.299: E/PowerManagerService(2008): WakeLock : binderDied()
05-28 10:37:13.299: E/PowerManagerService(2008): WakeLock : binderDied()
05-28 10:37:14.974: E/PushClient(1895): [a] MCC is same
05-28 10:37:18.724: E/Watchdog(2008): !@Sync 2286
05-28 10:37:20.364: E/MTPPlaObsrvr(22311): On change is called.false
05-28 10:37:20.364: E/MTPPlaObsrvr(22311): URI of the playlistcontent://media/external/audio/playlists
05-28 10:37:20.364: E/MTPPlaObsrvr(22311): Content resolver is not null
05-28 10:37:20.389: E/MTPPlaObsrvr(22311): Count1mCount1
05-28 10:37:20.389: E/MTPPlaObsrvr(22311): Neither deleted nor added. Could be rename
05-28 10:37:20.389: E/MTPPlaObsrvr(22311): It is not renamed
05-28 10:37:20.434: E/MetadataRetrieverClient(1733): setDataSource fd=45, offset=0, length=576460752303423487
05-28 10:37:20.434: E/MetadataRetrieverClient(1733): calculated length = 17294
05-28 10:37:23.134: E/PushClient(1895): [a] MCC is same
05-28 10:37:23.519: E/PushClient(1895): [a] MCC is same
05-28 10:37:29.489: E/DBG_DM(8369): Warning!!! [v5_1211_3_1][Line:2023][xdmCheckSystemRooting] Device is ok
05-28 10:37:29.589: E/DBG_DM(8369): Warning!!! [v5_1211_3_1][Line:2023][xdmCheckSystemRooting] Device is ok
05-28 10:37:29.639: E/DBG_DM(8369): Warning!!! [v5_1211_3_1][Line:2023][xdmCheckSystemRooting] Device is ok
05-28 10:37:29.699: E/DBG_DM(8369): Warning!!! [v5_1211_3_1][Line:2023][xdmCheckSystemRooting] Device is ok
05-28 10:37:32.539: E/PushClient(1895): [a] MCC is same
05-28 10:37:33.959: E/PowerManagerService(2008): WakeLock : binderDied()
05-28 10:37:36.384: E/PowerManagerService(2008): WakeLock : binderDied()
05-28 10:37:40.379: E/SensorManager(9016): thread start
05-28 10:37:40.934: E/MtpService(22311): In MTPAPP onReceive:android.intent.action.BATTERY_CHANGED
05-28 10:37:40.934: E/MtpService(22311): battPlugged Type : 2
05-28 10:37:42.169: E/PushClient(1895): [a] MCC is same
05-28 10:37:42.669: E/PushClient(1895): [a] MCC is same
05-28 10:37:48.724: E/Watchdog(2008): !@Sync 2287
05-28 10:37:59.459: E/PushClient(1895): [a] MCC is same
05-28 10:38:09.664: E/a(9549): Metric [API Handler - SubscribePushNotification (mobile)] Value [1144] (ms)
【问题讨论】:
【参考方案1】:有同样的问题。
正如 Idan 在将 ADT 更新到 22.0.1 后所写的那样。 确保从 Android 模拟器卸载旧应用程序并在测试前重新构建 Worklight 应用程序。
亚尼夫。
【讨论】:
也试过了,但还是不行。 @MohammedArif,来自 Android SDK 管理器,还请确保您已安装 Android Build Tools。【参考方案2】:看起来非常相似:
IBM Worklight 5.0.6.x - Hybrid Android application can't run on real device worklight auto-generated android folder does not run on avd发生这种情况是因为 Google 在此版本的 ADT 中进行了更改。 它仅影响 ADT v22 的用户。 Worklight 将在其下一个版本中对此进行内置修复。
同时,请遵循以下说明(基于每个项目):
-
右键单击您生成的 Android 项目并选择
“属性”
从左侧窗格中,选择“Java Build Path”
勾选“Android 私有库”复选框
刷新项目/重新构建应用程序
在 Android SDK 管理器中,还要确保您已安装 Android Build Tools。
应用现在应该在设备和/或模拟器中成功启动。
【讨论】:
Idan 在进行更改后仍然没有运气,当模拟器上的屏幕甚至将其部署到我的 android 手机中时出现空白,它显示相同的消息“不幸的是,'应用程序'已停止”。 这是一个新项目的样例还是什么?尝试一个新的 Worklight 项目,除了我的答案中的步骤外,什么都不做。告诉我这是怎么回事。 当然,给我一些时间,会回复你的,顺便说一句,这是一个新项目。 @MohammedArif,改变运气? 由于其他项目需求,不得不更换机器/平台,现在我在OSX上并没有看到问题,当然这不是问题的解决方案。以上是关于IBM Worklight - Android SDK - 模拟器部署问题 - 不幸的是,“应用程序”已停止的主要内容,如果未能解决你的问题,请参考以下文章
IBM Worklight - 如何使 Android 环境代码“独立于”生成的项目?
IBM Tealeaf 和 Worklight 6.1.0.01-2 Android 应用程序
IBM Worklight 5.0.5.2 - 如何更改 Android 包名称
IBM Worklight - Android 上的推送通知
IBM Worklight 6.0 - 无法在 avd 上使用适用于 android 环境的 dojo 工具包运行示例混合 Worklight 应用程序?