0

我在 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 ComponentInfo{com.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)
4

2 回答 2

0

有同样的问题。

正如 Idan 在将 ADT 更新到 22.0.1 后所写的那样。确保您正在从 Android 模拟器卸载旧应用程序并在测试之前重新构建 Worklight 应用程序。

亚尼夫。

于 2013-05-28T19:33:00.973 回答
0

似乎非常类似于:

这是由于 Google 在此版本的 ADT 中所做的更改。它仅影响 ADT v22 的用户。Worklight 将在其下一个版本中对此进行内置修复。

同时,请遵循以下说明(基于每个项目):

  1. 右键单击您生成的 Android 项目并选择“属性”
  2. 从左侧窗格中,选择“Java Build Path”
  3. 勾选“Android 私有库”复选框
  4. 刷新项目/重新构建应用程序

在 Android SDK 管理器中,还要确保您已经安装了 Android 构建工具。

该应用程序现在应该在设备和/或模拟器中成功启动。

于 2013-05-28T04:44:36.643 回答