由于我第一次遇到无法在Android模拟器中启动worklight应用程序,我重新安装了ADT包,升级到Luna并重新安装了用于ADT和worklight的ecplipse插件。我从kepler实例导入项目并成功运行通用应用程序。错误消息非常清楚,它无法加载wlclient.properties文件,但我无法弄清楚原因。我已经更改了只读属性并授予每个人完全控制权。 wlclient.properties文件确实存在于本机资产文件夹中,当我打开它时,没有问题,信息似乎正确。我正在使用标准设备定义,我也尝试过新设备。这是来自DDMS的堆栈转储:
10-23 11:34:55.770: D/dalvikvm(1749): Not late-enabling CheckJNI (already on)
10-23 11:34:55.850: W/ResourceType(1749): No known package when getting value for resource number 0x7f040000
10-23 11:34:55.850: W/PackageManager(1749): Failure retrieving text 0x7f040000 in package com.JSONstore
10-23 11:34:55.850: W/PackageManager(1749): android.content.res.Resources$NotFoundException: String resource ID #0x7f040000
10-23 11:34:55.850: W/PackageManager(1749): at android.content.res.Resources.getText(Resources.java:244)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ApplicationPackageManager.getText(ApplicationPackageManager.java:994)
10-23 11:34:55.850: W/PackageManager(1749): at android.content.pm.ComponentInfo.loadLabel(ComponentInfo.java:85)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ActivityThread.access$800(ActivityThread.java:135)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
10-23 11:34:55.850: W/PackageManager(1749): at android.os.Handler.dispatchMessage(Handler.java:102)
10-23 11:34:55.850: W/PackageManager(1749): at android.os.Looper.loop(Looper.java:136)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ActivityThread.main(ActivityThread.java:5017)
10-23 11:34:55.850: W/PackageManager(1749): at java.lang.reflect.Method.invokeNative(Native Method)
10-23 11:34:55.850: W/PackageManager(1749): at java.lang.reflect.Method.invoke(Method.java:515)
10-23 11:34:55.850: W/PackageManager(1749): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
10-23 11:34:55.850: W/PackageManager(1749): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
10-23 11:34:55.850: W/PackageManager(1749): at dalvik.system.NativeStart.main(Native Method)
10-23 11:34:55.850: W/ResourceType(1749): No known package when getting value for resource number 0x7f040000
10-23 11:34:55.850: W/PackageManager(1749): Failure retrieving text 0x7f040000 in package com.JSONstore
10-23 11:34:55.850: W/PackageManager(1749): android.content.res.Resources$NotFoundException: String resource ID #0x7f040000
10-23 11:34:55.850: W/PackageManager(1749): at android.content.res.Resources.getText(Resources.java:244)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ApplicationPackageManager.getText(ApplicationPackageManager.java:994)
10-23 11:34:55.850: W/PackageManager(1749): at android.content.pm.ComponentInfo.loadLabel(ComponentInfo.java:94)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ActivityThread.access$800(ActivityThread.java:135)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
10-23 11:34:55.850: W/PackageManager(1749): at android.os.Handler.dispatchMessage(Handler.java:102)
10-23 11:34:55.850: W/PackageManager(1749): at android.os.Looper.loop(Looper.java:136)
10-23 11:34:55.850: W/PackageManager(1749): at android.app.ActivityThread.main(ActivityThread.java:5017)
10-23 11:34:55.850: W/PackageManager(1749): at java.lang.reflect.Method.invokeNative(Native Method)
10-23 11:34:55.850: W/PackageManager(1749): at java.lang.reflect.Method.invoke(Method.java:515)
10-23 11:34:55.850: W/PackageManager(1749): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
10-23 11:34:55.850: W/PackageManager(1749): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
10-23 11:34:55.850: W/PackageManager(1749): at dalvik.system.NativeStart.main(Native Method)
10-23 11:34:55.900: D/AndroidRuntime(1749): Shutting down VM
10-23 11:34:55.900: W/dalvikvm(1749): threadid=1: thread exiting with uncaught exception (group=0xb0d8fb20)
10-23 11:34:55.950: E/AndroidRuntime(1749): FATAL EXCEPTION: main
10-23 11:34:55.950: E/AndroidRuntime(1749): Process: com.JSONstore, PID: 1749
10-23 11:34:55.950: E/AndroidRuntime(1749): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.JSONstore/com.JSONstore.JSONstore}: java.lang.RuntimeException: WLConfig(): Can't load wlclient.properties file
10-23 11:34:55.950: E/AndroidRuntime(1749): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
10-23 11:34:55.950: E/AndroidRuntime(1749): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
10-23 11:34:55.950: E/AndroidRuntime(1749): at android.app.ActivityThread.access$800(ActivityThread.java:135)
10-23 11:34:55.950: E/AndroidRuntime(1749): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
10-23 11:34:55.950: E/AndroidRuntime(1749): at android.os.Handler.dispatchMessage(Handler.java:102)
10-23 11:34:55.950: E/AndroidRuntime(1749): at android.os.Looper.loop(Looper.java:136)
10-23 11:34:55.950: E/AndroidRuntime(1749): at android.app.ActivityThread.main(ActivityThread.java:5017)
10-23 11:34:55.950: E/AndroidRuntime(1749): at java.lang.reflect.Method.invokeNative(Native Method)
10-23 11:34:55.950: E/AndroidRuntime(1749): at java.lang.reflect.Method.invoke(Method.java:515)
10-23 11:34:55.950: E/AndroidRuntime(1749): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
10-23 11:34:55.950: E/AndroidRuntime(1749): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
10-23 11:34:55.950: E/AndroidRuntime(1749): at dalvik.system.NativeStart.main(Native Method)
10-23 11:34:55.950: E/AndroidRuntime(1749): Caused by: java.lang.RuntimeException: WLConfig(): Can't load wlclient.properties file
10-23 11:34:55.950: E/AndroidRuntime(1749): at com.worklight.common.WLConfig.<init>(WLConfig.java:90)
10-23 11:34:55.950: E/AndroidRuntime(1749): at com.worklight.common.WLConfig.createInstance(WLConfig.java:96)
10-23 11:34:55.950: E/AndroidRuntime(1749): at com.worklight.wlclient.api.WLClient.createInstance(WLClient.java:190)
10-23 11:34:55.950: E/AndroidRuntime(1749): at com.worklight.common.Logger.setContext(Logger.java:478)
10-23 11:34:55.950: E/AndroidRuntime(1749): at com.worklight.androidgap.api.WL.<init>(WL.java:54)
10-23 11:34:55.950: E/AndroidRuntime(1749): at com.worklight.androidgap.api.WL.createInstance(WL.java:84)
10-23 11:34:55.950: E/AndroidRuntime(1749): at com.JSONstore.JSONstore.onCreate(JSONstore.java:20)
10-23 11:34:55.950: E/AndroidRuntime(1749): at android.app.Activity.performCreate(Activity.java:5231)
10-23 11:34:55.950: E/AndroidRuntime(1749): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
10-23 11:34:55.950: E/AndroidRuntime(1749): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
10-23 11:34:55.950: E/AndroidRuntime(1749): ... 11 more
10-23 11:34:55.990: D/dalvikvm(1749): GC_CONCURRENT freed 267K, 10% free 2972K/3296K, paused 19ms+0ms, total 70ms
这是wlclient.properties文件的内容。
wlServerProtocol = http
wlServerHost = 10.99.12.160
wlServerPort = 10080
wlServerContext = /FunWith/
wlAppId = JSONstore
wlAppVersion = 1.0
GcmSenderId =
enableSettings = false
testWebResourcesChecksum = false
ignoredFileExtensions =
webResourcesSize = 3462895
wlUid = kiWaVxEDXAUfwn/fyz3V8w==
wlPlatformVersion = 6.2.0.00.20140613-0730
wlMainFilePath = index.html
wlShareCookies =
wlShareUserCert = false
(我将主机名更改为ip地址作为测试。)
有任何想法吗?
谢谢, 帕克
答案 0 :(得分:0)
根据评论中的讨论,这似乎是本地配置问题。
我在VM上构建了另一个环境:Windows 8.1,worklight 6.2.0.1, 最新的android插件/ sdk,配置了一个带有atom / hax的AVD来运行 API级别19.这有效。我没有找到失败 wlclient.properties。