如何在Android Studio中更改Google Analytics帐户

问题描述:

正如您在下面的屏幕截图中看到的,我已经使用我的私人Google Analytics帐户为我的私人应用测试了Google Analytics。

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

现在,我还想继续使用我的商业应用程序,并希望输入我的公司电子邮件Google Analytics帐户,该帐户与该其他应用程序相结合。 如何在此处切换或注销?

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?


  1. 库依赖项编译'com.google.android.gms:play-services-analytics:8.4.0'从您的build.gradle。 (手动,而不是模块设置)

  2. 为避免错误,请注释Google Analytics代码。

  3. 执行gradle同步。 $ b
  4. 清理并建立您的项目。
    [ 4.1。为了安全起见,请执行无效缓存并从文件菜单重新启动。

  5. 返回到模块设置并启用分析。 (它现在应该再次请求登录。)

  6. 用您的新用户登录

  7. 取消您先前评论过的代码的注释。

  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.