Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Android build error on 5.4.1f1 with new Firebase analytics

Discussion in 'Android' started by kathode, Nov 9, 2016.

  1. kathode

    kathode

    Joined:
    Jan 15, 2013
    Posts:
    63
    Hi,

    I integrated Firebase analytics today. Everything went fine on the iOS side, but Android is now failing to build. It generates a HUGE error message and I can't make heads or tails of it to even tell where the actual error is. I had to relegate the message to pastebin.

    http://pastebin.com/PbR9CSVt

    If anyone could give it a scan and see what the issue might be, I'd really appreciate it. I really don't have a clue on how to proceed.
     
  2. oslav

    oslav

    Joined:
    Jun 2, 2015
    Posts:
    3
    Try using latest(or later) Android Build Tools.
     
  3. kathode

    kathode

    Joined:
    Jan 15, 2013
    Posts:
    63
    Thanks.

    I've identified the problem being due to a typical Android "multiple aar / jar" problem. The Firebase SDK includes a "PlayServicesResolver" that appears to force grab updates to play services jar files. This leads to an incompatibility with the Android Native plug-in (Stan's Assets) which also contains their own copies of those files. Unfortunately deleting the Firebase resolvers leads to a compilation error.

    Still experimenting with ways to resolve this.
     
    ilmario and liortal like this.
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Is Android Native up to date? or is it the earlier version of the mobile plugin by Stan's assets ?

    You should be able to delete the google play libraries included with Stan's assets and let the resolver add whatever needed into your project. Need to make sure nothing else breaks in this process.
     
  5. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    [Update: See further down the page for a complete solution - Working GAv4, Working Rewarded ads with mediation & 4 ad networks, Working crash reporting.]

    Hi,

    I'm about to try this maelstrom again. I feel very sorry for any other developers who have this same headache.

    We are getting some real attention from Unity on Android which is great. Superb work on the OpenGL/Vulkan systems for example. However this is one of those painfully obvious nasties that no one seems to want to touch.

    If a nice Unity representative can clearly say hand on heart how we can safely work with Google's Firebase system then it will save me and a lot of developers hours of wasted build effort.

    Heres my rather direct comments

    1. I am really annoyed that Google have not made a decent (non beta) plugin and that the GAv4 plugin never worked. I've had to launch an app with no stats in it due to this being too hard.
    2. Firebase is wasting a heck of a lot of time on iOS when Android doesn't work properly. Someone needs a reality adjustment at Big G.
    3. This is a classic cluster ****. Unitys analytics aren't useful when you need to use a google ad platform so it's useless, GAv4 doesn't work so it's useless and Firebase is a beta so it's potentially useless as well.
    4. I have seen countless reports on the about this on stackoverflow, in the Unity forums, the github repos and still no-one seems to give a damn that a massive chasm exists for us to get over. Comments like- 'we'll factor it into our decision process' don't cut it.
    5. This is making it very confusing and limiting our ability to upgrade to later versions of Unity as the plugins just break again.
    6. People are hiding behind betas, broken software and volunteer programming on what should be a simple tickbox feature. The Android Unity community is not happy about this.
    7. Solutions like deleting libraries and editing standard libraries are horrendous and pose a massive security risk. I refuse to juggle plugins/jars/aars etc just to get something broken and fudged in a half working way.
    8. Android is the worlds biggest platform, Games are biggest earner on Android, Unity is the main platform for Android Game development. Who at Firebase does not get that equation?? Stand up and wave your hand and tell us why we are at the back of your bus in terms of priority.
    9. Why did we need Firebase if Google Analytics was okay. I'm still very confused about this too.

    I appreciate that Unity and Google have competing product strains here but this is getting in the way of our development and it needs to stop. You're both at fault here and perhaps so am I due to not understanding the intricate nature of the two build systems but should I have to?

    *Rage Over* just want to see some "shake hands" on this please :)
     
    Last edited: Feb 8, 2017
    Hosnkobf, ilmario and Galfaroth like this.
  6. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Don't agree with this.

    I think that Unity should focus on improving the engine, instead of spending time on a particular SDK integration.
    It is the sole responsibility of the folks at Google who now own Firebase to make sure the integration with Unity (or any other platform) is as smooth as possible.

    Reading your entire list of comments only stresses out this point - Google should handle the integration of their services and SDKs with any platform they support.

    Is there an official Google analytics plugin for Unity ? (made by Google?)
    Is there an official Firebase plugin for Unity?

    If both are developed by Google, they are probably open sourced, so you (or fellow devs from the community) can always contribute to make it better.
     
  7. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    Hi

    If only it were that simple. Yes Google should but then again, it takes two to tango. Both parties have shown their extreme inability to perform anything other than the dance of the sugar plum elephant on this. Unity favours their own solution which is a fairly simple integration. Problem is we don't use it. Most of the world+dog uses Google because it works with Google Ads.

    The VR collab between the two companies is a good example of where the relationship is working.

    There is an official beta made by Google. That's my point. its a beta. It should be a core working part of Firebase not some piece of left over string that's tossed to the community.

    Its gone on for over a year now and I can see the effect on the community. Everyone is sick of it.

    GAv3 just worked. Firebase/GAv4 just don't. Regression central dude!
     
  8. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    Oh and in case anyone is wondering this is a stampy feet issue :) stamp stamp stamp ....& one more.stamp. LOL. Any other heavy animals are welcome to join me in my stampathon.
     
  9. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    Hi All,

    I'm working through the Firebase integration now.

    I'm getting this warning- extra-google-m2repository referenced by com.google.firebase:firebase-analytics:10+, com.google.android.gms:play-services-base:10+, com.google.firebase:firebase-common:10+ not available in the Android SDK. This package will not be installed.

    In the release notes is a cryptic comment about proguard manual integration and the m2repository but no steps on how to do it. : https://firebase.google.com/support/release-notes/unity

    when I work it out I will post but if someone could help that would be great.
     
  10. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    Oh great I just hit a build error in the Android-sdk. Unity is asking users to downgrade to 25.2.2 of Android sdk-tools. rolleyes...
     
  11. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    Right so I got that right and did the downgrade and finally in Android monitor logcat gives this message:

    Firebaseapp initialization successful

    :)

    Fortunately the proguard stuff wasn't needed (At least not yet...)

    Once installed The Firebase unity package initiates a lengthy download and install within Unity. You have to agree to terms of a licence. Until I got the sdk tools version right this process kept on failing.

    I will test some basic logging and give an update here. Unfortunately the data seems to need 24 hours to come through. Hmm... not very good for real-time stats it seems.

    I'm sure there are other good points right? Hopefully I will know what they are in a few days time.
     
  12. Dotby

    Dotby

    Joined:
    Nov 12, 2013
    Posts:
    32

    You need this:
     
  13. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    Hi Dotby,

    Thanks for that. Totally right.

    I have been using Firebase for a few days and I can see data coming in. Unfortunately its nothing like what I'm used to with Google Analytics. I really miss the hourly active user information and any form of realtime user data. Some other stuff is nice and it sure is a pretty interface.
     
  14. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    I've moved on now to Crash reporting. Something Google Analytics also did brilliantly.

    Heres the deal- No unity plugin for crash reporting from Firebase. Theres nothing nada zip. maybe its like a Tasmanian Tiger. Only spotted in the bush fleetingly on a very dark night?

    So we look at Unity's crash reporting- Um no device information. How on earth can I work out which handset has the problem if its device specific.

    I'm talking specifically from an Android perspective here. We don't do games for iOS. Its critical to know which handset has the issues.

    Me thinks the only sane thing to do is to retreat to GA3 and try the hacks that I have seen.

    So far the conclusion is that Firebase and Unity are focused on high level marketing and iOS. They both lack realtime stats and have no way of diagnosing exceptions on a device basis (or at all in Firebase's case).

    Currently in our beta VR app we have to rely on Youtube for realtime data. To any devs listening we use the realtime stats to change our marketing plans. That's not possible when you have to wait 24 hours for data.

    Here be dragons and a gaping chasm...and nobody from Unity/Google seems to want to own them.
     
    Last edited: Jan 29, 2017
  15. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    Okay. After two weeks work heres where we got to-

    disclaimer- this is for Unity 5.3.7

    * We ditched firebase. GAv4 worked after someone had fixed things in December. Good on that person. I salute you sir and will be first in line to have your babies.

    * Firebase wasn't all bad but we didn't need it. Its made for nice marketing type people with cool glasses who like summaries. The main issue is we track things hourly, thats impossible with FB. Google made a mistake steering people to FB before it could take over fully from GA for analytics. Also note FB always mentions iOS first. No matter what. I have a big problem with this. They clearly have less focus on Android than iOS (supporting stuff like Swift!!??! )

    * Crash Reporting was great as usual in GA4 so we didn't need Firebases or Unitys (dont use them as each has shortfalls like not mentioning the handset type?? and other such problems)

    * We moved on to ads and heres what we found: more dragons- Manifest files, project.property files all conflicting and multiple Google play resolvers vying for control of the system. How we killed the dragon: Admob mediation for Rewarded Video first then Unity ads plugin. Then we got Adcolony working (no SDK required), Then Chartboost then Fyber. Follow most of the instructions on this page https://firebase.google.com/docs/admob/ios/mediation-networks. Pay careful attention to install Unity plugins for admob where possible and put the jars etc in the Googleadmobplugins directory. Its best to edit the manifest yourself and add the necessary activities for each adapter. Don't let Unity packages change the resolver and pay attention to the min-sdk and max-sdk versions. Fixing these conflicts highlighted major issues with error reporting as often the elements causing the error are not clear. Note that although the plugins and adapters are on the Firebase's site, Firebase is not required at all.

    so in summary: Success = GAv4 + Admob plugin setup for Rewarded Video with mediation + pugins for- Unity, Adcolony, Chartboost, Fyber.

    I really hope that nobody in our lovely Unity3d Android community has to go through this pain again.

    Also note that if you don't care about mediation just use Unity Ads to start with. Its easy(ish) and I take back some of my comments about it. You wont get the best ecpm but it will work and was the simplest.
     
  16. swifer07

    swifer07

    Joined:
    May 27, 2013
    Posts:
    12
  17. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    Okay its my own post and its relevant so I'm raising this from the dead.

    Another bug now in Firebase Analytics which is because of metadata tags not merging for a thing called ComponentDiscoverService.

    The best way to sort this out is to move the metadata from one module into a single manifest. In my case I had to relocate i from the iIDReceiver manifest to the connector.impl one. I tried all the other options and they dont work.

    why did this happen-

    Firebase thought Unitys build system could handle it (They must have forgotten to test it properly) and Unity has not back ported the metadata merge to the Unity 5.6.6.

    Could you guys talk about this important stuff please.

    And look at the fallout, written all over the web. Hundreds of hours of dev time wasted for almost a year :-(

    https://github.com/firebase/quickstart-unity/issues/192#issuecomment-415622826
    https://stackoverflow.com/questions...veryservice-in-androidmanifest-merge-conflict
    https://github.com/firebase/quickstart-unity/issues/175
     
  18. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    Also to prove I like to point out good stuff as well.

    Firebase have listened about realtime data. After running the API json test I can see a user online with a nice map of where I am. Thats brilliant because before you had to wait 24 hrs before seeing anything.