我尝试添加AppLovin依赖项,但出现如下错误:
错误:无法解析':app @ debug / compileClasspath'的依赖项:
找不到“com.applovin:applovin-sdk:+”。显示受影响的详细信息
模组:app
错误:无法解决依赖关系
':app @ debugAndroidTest / compileClasspath':找不到
'com.applovin:applovin-sdk:+'。显示详细信息受影响的模块:app
错误:无法解决依赖关系
':app @ debugUnitTest / compileClasspath':找不到
'com.applovin:applovin-sdk:+'。显示详细信息受影响的模块:app
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'
repositories {
jcenter()
}
repositories {
// You can also use jcenter if you prefer
mavenCentral()
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId 'com.example.application'
minSdkVersion 21
targetSdkVersion 28
versionCode 2
versionName '1.3'
manifestPlaceholders = [
onesignal_app_id: '1234567891011121314',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE']
}
lintOptions {
disable 'MissingTranslation'
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
implementation 'com.daimajia.numberprogressbar:library:1.4@aar'
implementation 'com.amitshekhar.android:android-networking:0.2.0'
implementation 'com.google.code.gson:gson:2.7'
// implementation 'com.google.android.gms:play-services-ads:17.1.2'
implementation 'com.airbnb.android:lottie:2.7.0'
implementation 'com.jwang123.flagkit:flagkit:1.0'
implementation 'fr.bmartel:jspeedtest:1.32.1'
implementation 'com.github.anastr:speedviewlib:1.1.0'
implementation 'agency.tango.android:material-intro-screen:0.0.5'
implementation 'com.yarolegovich:lovely-dialog:1.1.0'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.12.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
// Required Dependency by Audience Network SDK
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.facebook.android:audience-network-sdk:5.4.1'
implementation "'com.applovin:applovin-sdk:+'"
}
apply plugin: 'com.google.gms.google-services'
最佳答案
在您的build.gradle文件中,从具有 applovin-sdk 实现依赖项的行中删除引号(“”)。
从:
dependencies {
implementation "'com.applovin:applovin-sdk:+'"
}
至:
dependencies {
implementation 'com.applovin:applovin-sdk:+'
}