Search code examples
androidandroid-studiogoogle-play-servicesgoogle-analytics-firebase

How change Google Analytics account in Android Studio


As you can see on the screenshot below, I already tested the Google Analytics with my private Google Analytics account for my private apps.

File --> Project Structure .. -> Developer Service --> Analytics

screenshot

Now, I would like to go play around with my business apps as well and would like to enter my corporate email Google Analytics account, which is combined to that other app. How can I switch or logout here?


Solution

    1. Remove the Analytics library dependency compile 'com.google.android.gms:play-services-analytics:8.4.0' from your build.gradle. (manually, not from module settings)
    2. To avoid errors comment out Analytics related code.
    3. Do a gradle sync.
    4. Clean and build your project. [4.1. Just to be safe Do an invalidate cache and restart from file menu.]
    5. Go back to module settings and enable Analytics. (It should now ask for a login again.)
    6. Login with your new user
    7. Uncomment the code that you commented earlier.