Unity: Firebase and Facebook SDK error build Android APK

2,142 views
Skip to first unread message

Kyo Kurosagi

unread,
Apr 21, 2017, 10:22:13 AM4/21/17
to Firebase Google Group
1) Create an empty project of unity
2) Import Latest FirebaseAuth.unity and FacebookSDK
3) Build Android apk and BOOM error.

Been searching for duplicate *.jar but didn't found any.
i had replace Proguard.bat as follows. But still got same error.

call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %1 %2 %3 %4 %5 %6 %7 %8 %9


Any luck with this issue?

CommandInvokationFailure: Unable to convert classes into dex format.
C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="E:/Users/Alex/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "E:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
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;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActionBarDrawerToggle;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActionBarDrawerToggle$1;

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:613)
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:498)
at SDKMain.main(SDKMain.java:129)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:605)
... 9 more
]
stdout[
processing archive E:\UnityProject\TooTiToo\Temp\StagingArea\android-libraries\animated-vector-drawable-23.4.0\libs\.\classes.jar...
processing android/support/graphics/drawable/AnimatedVectorDrawableCompat.class...
processing android/support/graphics/drawable/AnimatedVectorDrawableCompat$1.class...
processing android/support/graphics/drawable/AnimatedVectorDrawableCompat$AnimatedVectorDrawableCompatState.class...
processing

Stewart Miles

unread,
Apr 21, 2017, 12:51:40 PM4/21/17
to fireba...@googlegroups.com
We need more information, there are many build environment combinations.
  • Version of Firebase SDK
  • Version of Facebook SDK
  • Host Operating System
  • Unity version
  • Unity build settings (there are many for Android, exporting Android Studio project, internal build system, Android Resolver settings etc.)
Cheers,
Stewart

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/33d29b13-8430-4eec-9453-a442de3c649c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Igor Lucena

unread,
Aug 28, 2017, 7:49:44 PM8/28/17
to Firebase Google Group
Hi, 
I am with the same issue.

I am using :
facebook-unity-sdk-7.10.0
firebase_unity_sdk_4.1.0
Unity 5.6.0 building for Android
Windows 10 x64
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

Stewart Miles

unread,
Aug 28, 2017, 8:20:28 PM8/28/17
to Firebase Google Group
Ok I took a look at this and it turns out that Facebook are redistributing an older version of the Play Services Resolver (https://github.com/googlesamples/unity-jar-resolver) in their plugin which is overwriting the latest version we ship with Firebase.  This usually be handled by our VersionHandler component (https://github.com/googlesamples/unity-jar-resolver/tree/master/source/VersionHandler) but they've imported our plugin without using the -gvh_disable command line option (https://github.com/googlesamples/unity-jar-resolver/blob/master/source/VersionHandler/src/VersionHandler.cs#L107) which breaks the version management that would handle this issue.

I'm surprised you were able to build anything as the errors upon importing the Facebook plugin are fatal.

So here's what I did to get things to build:
  • Switch platform to desktop (to avoid Android resolution running)
  • Import FirebaseAuth plugin
  • Import Facebook plugin
  • Delete everything under PlayServicesResolver/Editor
  • Import the latest plugin from https://github.com/googlesamples/unity-jar-resolver
  • Make sure Android Resolver settings under "Assets > Play Services Resolver > Android Resolver > Settings" are the defaults (we really need a way to reset to default):
  • Switch to Android platform.  You should see the following under Plugins/Android/

  • Regenerate your Facebook manifest (under "Facebook > Edit Settings > Regenerate Android Manifest"  
  • Build and bask in the glory of an APK with Firebase Auth & Facebook.
Cheers,
Stewart







To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Stewart Miles

unread,
Aug 28, 2017, 8:31:52 PM8/28/17
to Firebase Google Group
I've filed an issue with Facebook here https://github.com/facebook/facebook-sdk-for-unity/issues/98

Cheers,
Stewart
Reply all
Reply to author
Forward
0 new messages