Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating Firebase Admob with Firebase Remote Config? #314

Closed
chuakc92 opened this issue Nov 29, 2016 · 11 comments

Comments

@chuakc92
Copy link

commented Nov 29, 2016

Is it possible currently to implement both plugins in the same project?

I've been trying to do so the whole day, but my app crashes on startup on my Android folder with the following error:
http://pastebin.com/5GYMdrbd

I'm using Unity 5.3.5f

@stewartmiles

This comment has been minimized.

Copy link

commented Nov 29, 2016

This is cross posted from firebase/quickstart-unity#9 (comment)

@chuakc92

This comment has been minimized.

Copy link
Author

commented Nov 29, 2016

Did you mean error logs in Unity or in Android Monitor?

There were no errors in Unity.

For Android Monitor, the pastebin link was all the log I could find from this application.

Could you tell me what is the correct step to integrating Firebase Remote Config and Google Mobile Ads so I could test it out for you?

@stewartmiles

This comment has been minimized.

Copy link

commented Nov 29, 2016

You mentioned on the other thread that you tried...

  • Resolve Client Jar, which replaces some play-services files with their 10.0.0 variant (not doing so throws a Failed to repackage resources error in Unity when building)
  • Importing Google Play Games, which doesn't fix anything

This was after you successfully built without errors and ended up with a crash when loading the application on your Android device?

@chuakc92

This comment has been minimized.

Copy link
Author

commented Nov 29, 2016

Using the quickstart testapp:

  1. Imported Firebase and google-services.json
  2. Build failed- throws a Failed to repackage resources error
  3. Resolve Client Jar - Resolve Client Jar, which replaces some play-services files with their 10.0.0 variant
  4. Build successful
  5. Everything working perfectly, including Remote Config.
  6. Imported Google Mobile Ads
  7. Unity asks if I wanted to delete obsolete Google.IOSResolver, Google.JarResolver, Google.VersionHandler, play-services-resolver v1.2.2.0.
  8. Clicked yes
  9. Build successful
  10. App crashes immediately and throws: http://pastebin.com/5GYMdrbd
  11. Resolve Client Jar
  12. Build successful
  13. App crashes immediately and throws: http://pastebin.com/5GYMdrbd
  14. Imported Google Play Games
  15. Build successful
  16. App crashes immediately and throws: http://pastebin.com/5GYMdrbd
@rampara

This comment has been minimized.

Copy link
Contributor

commented Nov 30, 2016

This issue is caused by Firebase and AdMob using conflicting Google Play services dependency versions. As a workaround, do the following:

  1. Edit the versions of dependencies declared Assets/Firebase/Editor/AppDeps.cs from "9.8+" to "LATEST". (Lines 43, 44, 45)
  2. Delete the following files from the Assets/Plugins/Android directory of your Unity project
  • firebase-common-9.8.0
  • firebase-common-9.8.0.meta
  • firebase-iid-9.8.0
  • firebase-iid-9.8.0.meta
  • firebase-config-9.8.0
  • firebase-config-9.8.0.meta

There will be updates made to the Play Services Resolver library to account for conflicting version dependencies, resolving this issue without the aforementioned workaround.

@rampara rampara added the plugin bug label Nov 30, 2016

@chuakc92

This comment has been minimized.

Copy link
Author

commented Nov 30, 2016

Hello rampara,

I did all of those and, unfortunately, it didn't work.

These were my steps:

  1. Import Firebase Remote Config into quickstart-unity Remote Config testapp
  2. Build successful, but crashes after Unity logo
  3. Resolve Client Jars, which replaces some play-services files with their 10.0.1 variant
  4. Build Successful and working perfectly
  5. Import GoogleMobileAds
  6. Build failed - Failed to repackage resources http://pastebin.com/Pf3enJy9 and http://pastebin.com/yTbg7sSi
  7. Resolve Jar
  8. Deleted:
    firebase-common-9.8.0
    firebase-common-9.8.0.meta
    firebase-iid-9.8.0
    firebase-iid-9.8.0.meta
    firebase-config-9.8.0
    firebase-config-9.8.0.meta
  9. Build Successful, but crashes after Unity logo - http://pastebin.com/L6gUTQTd
  10. Import Google Play Games
  11. Build Successful, but crashes after Unity logo - http://pastebin.com/MifarDMP
  12. Resolve Client Jars
  13. Deleted:
    firebase-common-9.8.0
    firebase-common-9.8.0.meta
    firebase-iid-9.8.0
    firebase-iid-9.8.0.meta
    firebase-config-9.8.0
    firebase-config-9.8.0.meta
  14. Build Successful, but crashes after Unity logo - http://pastebin.com/x7PhhjSk
@rampara

This comment has been minimized.

Copy link
Contributor

commented Dec 1, 2016

@chuakc92 did you modify the the versions of dependencies declared Assets/Firebase/Editor/AppDeps.cs from "9.8+" to "LATEST"?

@chuakc92

This comment has been minimized.

Copy link
Author

commented Dec 1, 2016

Yes, I did.

@edumlauer

This comment has been minimized.

Copy link

commented Dec 2, 2016

@chuakc92 you can try this:

Close Unity, edit any other *Deps.cs you might have in Assets/Firebase/Editor, in my case it was AnalyticsDeps.cs and so I edited lines 43 and 44 to "LATEST".

Delete all files from Assets/Plugins/Android with versions prior to 10.0.1.

Reopen Unity and see if this fixes it for you, it did the job for me.

Editing only AppDeps.cs made so it wouldn't crash at launch but then another exception was thrown when I tried to log an event with Firebase Analytics.

@tuilanhim

This comment has been minimized.

Copy link

commented Dec 3, 2016

@edumlauer This is how I do based on your instruction.

  1. Keep these "*-unity" lines as default (1.0.0) and change other lines to "LATEST".
  2. Turn Assets > Play Services Resolver Settings > Android Resolver > Enable Background Resolution to false
  3. Remove all 9.8.0 & 10.0.1 version files
  4. Do Assets > Play Services Resolver Settings > Android Resolver > Resolve Client Jars
  5. Build for Android and get "Unable to convert classes to dex format"
  6. Remove all Firebase Auth files in Android folder
  7. Re-build and now I can get remote settings
@chuakc92

This comment has been minimized.

Copy link
Author

commented Dec 5, 2016

Thank you, @edumlauer and @tuilanhim, I finally got it to work!

For anyone else facing this problem, here's what I did:

  1. Import Firebase Remote Config into quickstart-unity Remote Config testapp
  2. Import GoogleMobileAds
  3. Resolve Client Jars
  4. Went into AppDeps and changed JUST line 43 and 44 from "9.8+" to "LATEST"
  5. Deleted:
    firebase-common-9.8.0
    firebase-common-9.8.0.meta
    firebase-iid-9.8.0
    firebase-iid-9.8.0.meta
    firebase-config-9.8.0
    firebase-config-9.8.0.meta
  6. Resolve Client Jars
  7. Your Android >> Plugin folder should look like this now: http://imgur.com/a/bykBG
  8. Build

Remote Config is working now. Going to test Mobile Ads.

@chuakc92 chuakc92 closed this Dec 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.