我收到了这个奇怪的错误。当我昨天晚上回来工作时,我遇到了这个错误。我不明白的是我从未改变过代码中的任何内容。感觉就像它出现了。
07-21 01:23:52.051 27020-27020/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.thinkinetics.rob.routinebuilder, PID: 27020
java.lang.RuntimeException: Unable to instantiate service com.thinkinetics.rob.RoutineWatchface: java.lang.ClassNotFoundException: Didn't find class "com.thinkinetics.rob.RoutineWatchface" on path: DexPathList[[zip file "/data/app/com.thinkinetics.rob.routinebuilder-2/base.apk"],nativeLibraryDirectories=[/data/app/com.thinkinetics.rob.routinebuilder-2/lib/arm, /vendor/lib, /system/lib]]
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2862)
at android.app.ActivityThread.-wrap4(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.thinkinetics.rob.RoutineWatchface" on path: DexPathList[[zip file "/data/app/com.thinkinetics.rob.routinebuilder-2/base.apk"],nativeLibraryDirectories=[/data/app/com.thinkinetics.rob.routinebuilder-2/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2859)
at android.app.ActivityThread.-wrap4(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Suppressed: java.lang.ClassNotFoundException: Didn't find class "com.thinkinetics.rob.RoutineWatchface" on path: DexPathList[[dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-support-annotations-23.0.0_46201fc775bd6a2a1b3e71eae86ef67f12babd28-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-internal_impl-23.0.0_93b2086be48ba8bf011786c70052b2e5db3ad593-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-com.google.android.support-wearable-1.3.0_c1d538a0bc8f53c23014746aa746d7950ae7bc3a-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-com.google.android.gms-play-services-wearable-8.4.0_921a6b02116cb3c5229600c4895d4c7fb55e5cef-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-com.google.android.gms-play-services-basement-8.4.0_3194cc3fb6ccb6c92a69d7fc4ace71b161b64889-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-com.google.android.gms-play-services-base-8.4.0_30a8813ef567e92576c485da70ce277d4fc2397e-classes.dex", dex file "/data/data/com.thinkinetics.rob.routinebuilder/files/instant-run/dex/slice-com.android.support-support-v4-23.0.0_7bc710f5526f9681c52eb6e494ababfb
注意:我确实搜索了同样问题的其他问题,但我找到了一些问题。但是,我遵循了这些帖子的每一条建议,但对我没有帮助。在浪费了我的整个晚上后,我认为在这里发帖是个好主意。
我不确定我的代码的哪些部分,如果有的话,我应该发布这个,所以我会积极地看看这个,并在必要时进行编辑。
这是清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thinkinetics.rob">
<uses-feature android:name="android.hardware.type.watch" />
<!-- Required to act as a custom watch face. -->
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@android:style/Theme.DeviceDefault">
<service
android:name=".RoutineWatchface"
android:label="@string/my_digital_name"
android:permission="android.permission.BIND_WALLPAPER">
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/watch_face" />
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/preview_digital" />
<meta-data
android:name="com.google.android.wearable.watchface.preview_circular"
android:resource="@drawable/preview_digital_circular" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
</intent-filter>
</service>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
</manifest>
谢谢。
答案 0 :(得分:0)
我刚才遇到了同样的问题。我从设备上卸载了应用程序,重新构建了项目,然后再次安装。这次我没有遇到问题,而且工作正常。
这可能是工作室中即时播放功能的一些间歇性错误。