无法解决:com.android.installreferrer:installreferrer

Max*_*tin 4 android referrer android-studio

关注https://android-developers.googleblog.com/2017/11/google-play-referrer-api-track-and.html

播放安装Referrer Library 1.0现已推出

为了便于集成Install Referrer API,我们发布了适用于Android的Install Referrer Library 1.0.该库可在我们的Maven存储库中找到.要开始使用它,请将以下依赖项添加到app模块build.gradle文件中:

dependencies {
      ...
      compile 'com.android.installreferrer:installreferrer:1.0'
  }
Run Code Online (Sandbox Code Playgroud)

但是它给了我错误:

无法解决:com.android.installreferrer:installreferrer:1.0

Max*_*tin 5

确保您已google()在项目根目录中添加了ae:

allprojects {
    repositories {
        google()

        // If you're using a version of Gradle lower than 4.1, you must
        // instead use:
        // maven {
        //     url 'https://maven.google.com'
        // }
    } }
Run Code Online (Sandbox Code Playgroud)

在他们的DOC中没有提到它