2016-07-21 26 views
0

Ich bekomme diesen seltsamen Fehler. Als ich gestern Nacht wieder zur Arbeit kam, war ich mit diesem Fehler konfrontiert. Was ich nicht verstanden habe ist, dass ich nie etwas im Code geändert habe. Es fühlt sich an, als käme es aus heiterem Himmel.Android: ClassNotFoundException

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 

Hinweis: habe ich mit dem gleichen Problem für andere Fragen suchen und ich habe einige finden. Ich habe jedoch alle Hinweise zu diesen Posts befolgt und es hat mir nicht weitergeholfen. Nachdem ich meine ganze Nacht verschwendet hatte, dachte ich, es wäre eine gute Idee, hier zu posten.

Ich bin nicht sicher, welche Teile meines Codes, wenn überhaupt, sollte ich zusammen mit diesem Posten, also werde ich dies aktiv betrachten und gegebenenfalls bearbeiten. Hier

ist die Manifest-Datei:

<?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> 

Danke.

+0

teilen Sie Ihre Manifest-Datei –

+0

@AshishRanjan Danke. Die Datei wurde hinzugefügt. –

Antwort

0

Ich habe das gleiche Problem gerade jetzt. Ich habe die App vom Gerät deinstalliert, das Projekt neu erstellt und dann erneut installiert. Diesmal hatte ich kein Problem und es funktionierte gut.

Es könnte sich um einen zeitweiligen Fehler mit der Sofortstartfunktion im Studio handeln.