- Home /
Firebase and Facebook SDK not building
I'm trying to integrate Firebase and Facebook. I implemented the functionality and now I'm trying to make a build on Android.
I keep getting various errors when building, from the dex format issue (where there are too many classes) to this:
CommandInvokationFailure: Failed to re-package resources.
C:\Users\laur\AppData\Local\Android\Sdk\build-tools\27.0.2\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "C:/Users/laur/AppData/Local/Android/Sdk\platforms\android-27\android.jar" -F bin/resources.ap_ --extra-packages android.support.graphics.drawable.animated:android.support.v7.appcompat:android.support.v7.cardview:android.support.customtabs:android.support.compat:android.support.coreui:android.support.coreutils:android.support.fragment:android.support.mediacompat:android.support.v4:android.support.graphics.drawable:com.google.android.gms.base:com.google.android.gms.base.license:com.google.android.gms:com.google.android.gms.common.license:com.google.android.gms.tasks:com.google.android.gms.tasks.license:com.google.firebase.measurement:com.google.firebase.measurement_impl:com.google.firebase.measurement.impl.license:com.google.firebase.measurement.license:com.google.firebase.unity.app:com.google.firebase.auth:com.google.firebase.firebase.auth.api.license:com.google.firebase.unity.auth:com.google.firebase.firebase_common:com.google.firebase.firebase.common.license:com.google.firebase.firebase_core:com.google.firebase.iid:com.google.firebase.firebase.iid.license:com.unity.purchasing:com.facebook.android:com.facebook.applinks:com.facebook.common:com.facebook.core:com.facebook.login:com.facebook.messenger:com.facebook.places:com.facebook.share:com.google.firebase.unity:com.android.vending.billing:com.unity.purchasing.googleplay:com.unity3d.ads -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.animated-vector-drawable-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.cardview-v7-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.customtabs-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.support-compat-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.support-core-ui-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.support-core-utils-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.support-fragment-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.support-media-compat-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.support-v4-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.support-vector-drawable-25.3.1\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.google.android.gms.play-services-base-11.8.0\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.google.android.gms.play-services-basement-11.8.0\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.google.android.gms.play-services-tasks-11.8.0\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.google.firebase.firebase-analytics-11.8.0\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.google.firebase.firebase-analytics-impl-11.8.0\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.google.firebase.firebase-auth-11.8.0\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.google.firebase.firebase-common-11.8.0\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.google.firebase.firebase-iid-11.8.0\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\common\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\facebook-android-wrapper-7.11.0\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\facebook-applinks\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\facebook-common\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\facebook-core\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\facebook-login\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\facebook-messenger\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\facebook-places\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\facebook-share\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\Firebase\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\GoogleAIDL\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\GooglePlay\res" -S "D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\unity-ads\res"
stderr[
D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_action_mode_close_item_material.xml:17: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <ImageView>
D:\CleverEdge Games\Mega Mall Rush\Temp\StagingArea\android-libraries\com.android.support.appcompat-v7-25.3.1\res\layout\abc_action_mode_close_item_material.xml:17: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <ImageView> ETC..........
I have: Windows 10 Unity 5.6 (for this project) Firebase v4.4.2 (I only need the database feature so I only imported the Database package) Facebook 7.11.0 PlayServicesResolver v1.2.61.0
Step by step, I did: In my Unity project containing only gameplay code:
I imported the Firebase SDK
Imported the Facebook SDK
Agreed to remove the older version of the PlaySolver (which came with Facebook SDK)
Went to Assets/Play Services Solver/ Android / Resolve
Tried to build and got the error in the screenshot.
Here is how the Plugins Android folder looks like:
I only need the Realtime Database for Firebase, so I assume most of the libraries there are not even needed.
Could anyone help me getting this to work? I've been bashing my head against it for days now.
Thank you!
Experiencing same Error, i'm integrating Firebase Cloud messaging + Facebook. did you found solution ?
Not exactly sure.
I mean, I got it working in a "dirty" way.
I removed all .aar files and stuff imported by the PlayServicesResolver.
I selected Force Resolve (Assets/Play Services Solver) and it imported back everything (about 90$$anonymous$$ classes, so I couldn't build because of the dex error)
I built and exported with gradle to Android Studio, then enabled multidex in there.
Fixed some other error that occured in there by google-ing.
It worked in the end. So now each time I want to get the .apk on the device, I have to redo step 3/4. Works, but It is not recommended enable-ing multidex.
Answer by marauderkr · May 14, 2018 at 06:27 AM
Greetings!
I have the same problem with the latest facebook SKD and firebase SDK both in the same Unity project. I don't have a solution yet, but I wondered if someone else of all followers of this question maybe already found a solution or a workaround for the problem? I would be glad if someone could share a workaround, as facebook seems to ignore this issue since august 2017.
Regards, Dominik
Hello.
I left a comment with the fix on my initial question.
Not recommended by Android/Unity to enable multidex, but fixes the issue and I haven't had any issues with my published app because of this.
Hello, Thank you for your comment! I Still hope there will be a fix from facebook soon...