com.onesignal:OneSignal 没有可用的版本 等级错误

no versions of com.onesignal:OneSignal are available grade error

我收到以下错误我们不知道在哪里

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any matches for com.onesignal:OneSignal:[3.9.1,3.99.99] as no versions of com.onesignal:OneSignal are available.

我不明白为什么会这样。任何帮助将不胜感激。

这是我的整个 gradle 文件。

buildscript {
    repositories {
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.11.0, 0.99.99]'
    }
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

repositories {
    maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'

android {
    useLibrary 'org.apache.http.legacy'
    compileSdkVersion 28
    defaultConfig {
        applicationId "-----"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 65
        versionName "1.0.65"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        manifestPlaceholders = [
                onesignal_app_id: '-----',
                onesignal_google_project_number: 'REMOTE'
        ]
    }
    buildTypes {
        release {
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    buildToolsVersion '26.0.2'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.github.apl-devs:appintro:v4.2.3'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.google.firebase:firebase-database:16.0.3'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-v4:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.google.android.gms:play-services-ads:11.8.0'
    implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'

    implementation 'com.android.volley:volley:1.1.1'
    implementation 'de.hdodenhof:circleimageview:3.1.0'

    compile 'com.google.zxing:core:3.2.1'
    compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
}

apply plugin: 'com.google.gms.google-services'

我也遇到了这个问题。 我将版本更改为 3.1.9,如下所示,一切正常。 我的意思是这样的:

compile 'com.onesignal:OneSignal:3.9.1'

对我来说也是工作!谢谢

信息:配置 'compile' 已过时,已替换为 'implementation' 和 'api'。

像这样更改行

implementation 'com.onesignal:OneSignal:3.9.1'