Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
877 views
in Technique[技术] by (71.8m points)

unity3d - Google.JarResolver.ResolutionException: Cannot resolve com.google.firebase:firebase-analytics-unity:1.0.0()

In my Unity project, I used some assets like FacebookSDK, OneSignal etc. Whenever I import OneSignal, this error will be shown.

Google.JarResolver.ResolutionException: Cannot resolve com.google.firebase:firebase-analytics-unity:1.0.0()

I had tried many things, these are what I remember:

  • Using 'Play Service Resolver' does not solve the problem.
  • Importing Unity Firebase.

When I import Firebase, the error turn into another error, which is building error called CommandInvokationFailure, related to Firebase.

I spent several days to fix it, but still I couldn't. If you need further information, tell me please.

EDIT: @nika Thanks for reply. I tried every combination of API 23-24-25 and build tools from 23 to 25. But, I can't fix 'CommandInvokationFailure' yet. I think sharing the full log of the error will be better:

CommandInvokationFailure: Unable to convert classes into dex format.
/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/emre/Desktop/AndroidSDK/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -

stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzah;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzcn;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/BuildConfig;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoJellyBeanMr2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/animation/AnimatorCompatHelper;

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at SDKMain.main(SDKMain.java:129)
Caused by: java.lang.InterruptedException: Too many errors
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
    ... 9 more
]

EDIT 2: @jkasten Thanks for reply. I can fix Android Support Library v4 Errors, however, for the second one is not easy because of resolvers.

play-services files

There is no duplicated play-services files. This time, I improvised to solve it: removing play-services-ads-9.0.1 from android build by changing import settings(if other ads file is removed, the CommandInvokationFailure error continues.). I don't really know it is the right way to solve the problem, but it worked somehow. But it leads me another error when I tried to run game on my phone:

FATAL EXCEPTION: main
E/AndroidRuntime(18680): java.lang.NoSuchMethodError: No static method zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzaa; or its super classes (declaration of 'com.google.android.gms.common.internal.zzaa' appears in /data/app/***/base.apk)
E/AndroidRuntime(18680):    at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
E/AndroidRuntime(18680):    at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
E/AndroidRuntime(18680):    at android.app.ActivityThread.installProvider(ActivityThread.java:5159)
E/AndroidRuntime(18680):    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4754)
E/AndroidRuntime(18680):    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4694)
E/AndroidRuntime(18680):    at android.app.ActivityThread.access$1600(ActivityThread.java:150)
E/AndroidRuntime(18680):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
E/AndroidRuntime(18680):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(18680):    at android.os.Looper.loop(Looper.java:148)
E/AndroidRuntime(18680):    at android.app.ActivityThread.main(ActivityThread.java:5423)
E/AndroidRuntime(18680):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18680):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
E/AndroidRuntime(18680):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...