51864


みていただきありがとうございます

unityにて自作したプラグインを実行した際に以下のようなエラーが発生しました。

[code]

    W/dalvikvm(11322): Unable to resolve superclass of Lcom/google/firebase/messaging/FirebaseMessagingService; (4817)
    W/dalvikvm(11322): Link of class 'Lcom/google/firebase/messaging/FirebaseMessagingService;' failed
    W/dalvikvm(11322): Unable to resolve superclass of Lcom/myplugin/fcm/CustomMessagingService; (4825)
    W/dalvikvm(11322): Link of class 'Lcom/myplugin/fcm/CustomMessagingService;' failed
    E/dalvikvm(11322): Could not find class 'com.myplugin.fcm.CustomMessagingService', referenced from method com.myplugin.fcm.Provider.initialize
    W/dalvikvm(11322): VFY: unable to resolve const-class 6000 (Lcom/myplugin/fcm/CustomMessagingService;) in Lcom/myplugin/fcm/Provider;
    W/ComponentDiscovery(11322): Application info not found.
    W/ComponentDiscovery(11322): Could not retrieve metadata, returning empty list of registrars.
    W/dalvikvm(11322): VFY: unable to resolve virtual method 584: Landroid/content/Context;.createDeviceProtectedStorageContext ()Landroid/content/Context;
    W/dalvikvm(11322): VFY: unable to resolve virtual method 592: Landroid/content/Context;.getCodeCacheDir ()Ljava/io/File;
    W/dalvikvm(11322): VFY: unable to resolve virtual method 593: Landroid/content/Context;.getColor (I)I
    W/dalvikvm(11322): VFY: unable to resolve virtual method 594: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
    W/dalvikvm(11322): VFY: unable to resolve virtual method 596: Landroid/content/Context;.getDataDir ()Ljava/io/File;
    W/dalvikvm(11322): VFY: unable to resolve virtual method 597: Landroid/content/Context;.getDrawable (I)Landroid/graphics/drawable/Drawable;
    W/dalvikvm(11322): VFY: unable to resolve virtual method 604: Landroid/content/Context;.getNoBackupFilesDir ()Ljava/io/File;
    W/dalvikvm(11322): VFY: unable to resolve virtual method 617: Landroid/content/Context;.isDeviceProtectedStorage ()Z
    W/dalvikvm(11322): VFY: unable to resolve virtual method 634: Landroid/content/Context;.startForegroundService (Landroid/content/Intent;)Landroid/content/ComponentName;
    E/Unity   (11322): AndroidJavaException: java.lang.NoClassDefFoundError: com.myplugin.fcm.CustomMessagingService
    E/Unity   (11322): java.lang.NoClassDefFoundError: com.myplugin.fcm.CustomMessagingService
    E/Unity   (11322):  at com.myplugin.fcm.Provider.initialize(Provider.java:18)
    E/Unity   (11322):  at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    E/Unity   (11322):  at com.unity3d.player.UnityPlayer.c(Unknown Source)
    E/Unity   (11322):  at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source)
    E/Unity   (11322):  at android.os.Handler.dispatchMessage(Handler.java:98)
    E/Unity   (11322):  at android.os.Looper.loop(Looper.java:136)
    E/Unity   (11322):  at com.unity3d.player.UnityPlayer$c.run(Unknown Source)
    E/Unity   (11322):   at UnityEngine.AndroidJNISafe.CheckException () [0x0008c] in /Users/builduser/buildslave/unity/build/Runtime/Export/AndroidJNISafe.cs:24 
    E/Unity   (11322):   at UnityEngine.AndroidJNISafe.CallStaticVoidMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00011] in /Users/builduser/buildslave/unity/build/Runtime/Export/AndroidJNISafe.cs:202 
    E/Unity   (11322):   at UnityEngine.AndroidJavaObject._CallStatic (Sy
    
[/code]

以下のようなクラスです

[code]

    public class CustomMessagingService extends FirebaseMessagingService {
    ...
    }
    
[/code]

FirebaseMessagingServiceがapkに含まれていないのではないかと思い、AndroidStudioでAnalyzeしてみましたが、含まれているようでした。  
[![画像の説明をここに入力](https://i.stack.imgur.com/GfSjh.png)](https://i.stack.imgur.com/GfSjh.png)

原因に検討がつかず、質問させていただきます。  
よろしくお願いします


CC BY-SA 4.0
2019-01-10T07:46:54.123
51860
2019-01-10T10:26:34.270
31743
question
android java unity3d
Unityで実行時にUnable to resolve superclassエラー


自己解決しました。  
superclass of FirebaseMessagingService  
なのでFirebaseMessagingServiceがあっても関係ありませんでした・・・

[code]

    FirebaseMessagingService extends zzb
    
[/code]

でしたのでzzbが含まれている com.google.firebase.iid を含むことで解決しました


CC BY-SA 4.0
2019-01-10T10:26:34.270
51864
2019-01-10T10:26:34.270
31743
51860
answer