Android 实施 OneSignal 时出现找不到任何匹配错误

Android Implementing OneSignal and I get Could not find any matches error

在尝试为我的项目实施 OneSignal 时出现此错误:

Could not find any matches for com.google.android.gms:play-services-gcm:+ as no versions of com.google.android.gms:play-services-gcm are available.

我从 SDK 管理器安装了 GooglePlay 服务

Post 更新:

android { compileSdkVersion 24 buildTools版本“24.0.2” 默认配置 {

    manifestPlaceholders = [onesignal_app_id: "MY APP ID",
                            onesignal_google_project_number: "REMOTE"]

    applicationId "com.kermany.behandam"
    minSdkVersion 16
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:cardview-v7:+'
    compile 'com.jakewharton:butterknife:8.2.1'
    apt 'com.jakewharton:butterknife-compiler:8.2.1'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.bugsnag:bugsnag-android:+'
    compile 'com.kogitune:pre-lollipop-activity-transition:1.3.0'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile 'cat.ereza:customactivityoncrash:1.5.0'
    apt "org.androidannotations:androidannotations:4.0.0"
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.android.support:design:24.2.1'
    compile 'com.makeramen:roundedimageview:2.2.1'

    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'

    compile 'org.greenrobot:eventbus:3.0.0'
    compile 'com.balysv:material-ripple:1.0.2'

    compile 'com.facebook.rebound:rebound:0.3.8'
    compile 'com.bugsnag:bugsnag-android:3.+'

    compile 'com.github.hotchemi:permissionsdispatcher:2.1.3'
    apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.3'

    compile 'net.danlew:android.joda:2.9.5'
    compile 'com.jaredrummler:android-device-names:1.1.2'

    compile 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:0.6.5'

    compile 'com.onesignal:OneSignal:3.+@aar'

    compile 'com.google.android.gms:play-services-gcm:+'

    compile 'com.google.android.gms:play-services-location:+'
}

从上面的截图来看你还没有安装

Google Repository

安装 "Google Repository" 并重新启动您的工作室,这将解决您的问题。还要检查你是否有任何旧的 SDK 安装和你从工作室安装的一个,由于冲突,我遇到了类似的问题 long back.Please see screenshot