I'm trying to mediate my app with MAX and I'm having trouble trying to integrating it on my Gradle file I have followed all the instructions here but I keep the error log below every time I try to build my app :
A problem occurred configuring project ':app'.
> Could not resolve all artifacts for configuration ':app:classpath'.
> Could not find com.applovin.quality:AppLovinQualityServiceGradlePlugin:.
Required by:
project :app
My Gradle file :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://artifacts.applovin.com/android' }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.google.gms:google-services:4.3.10'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My Gradle App level :
buildscript {
repositories {
google()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.7'
classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:"
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'applovin-quality-service'
applovin {
apiKey "########JW3nelTryi1TlKCldNWG-wtTZGhEz_Tpu-ByT6bsZccJT4rABgGP9HNBQqcmywT7_rMvrl0zQvn"
}
android {
compileSdkVersion 31
defaultConfig {
applicationId "com.wallpapers_8k_Sad.app"
minSdkVersion 19
targetSdkVersion 31
versionCode 8
multiDexEnabled true
versionName "1.08"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.appcompat:appcompat:1.4.1'
compile 'com.facebook.android:audience-network-sdk:6.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.google.firebase:firebase-database:20.0.4'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.google.ads.mediation:facebook:6.8.0.0'
implementation 'com.google.android.gms:play-services-ads:20.6.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.applovin:applovin-sdk:+'
implementation 'com.onesignal:OneSignal:4.3.0'
}
My manifest meta line :
<meta-data android:name="applovin.sdk.key"
android:value="######oRQNDu54FZ1Sr7DocsC0hcs-3ZD91eX-OXTxFK75Qg_EANzzxoKr9lxTdgIh3c-G5os5ykNx2gz4Q5x"/>
N/B - The hashtags added are just added manually to hide my keys.
Found out I needed to add the applovin dependency inside the gradle top level build file adding the specific version as well
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://artifacts.applovin.com/android' }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.google.gms:google-services:4.3.10'
classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:4.3.7"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Related
I have followed this link with no success to solving the issue.
and this Plugin with id 'com.google.gms.google-services' not found
A Screen shot of the error displyed
This is my build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "example.technerd.com.firebaseauthentication"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
apply plugin: 'com.google.gms.google-services'
This is my build.gradle(Project:ProjectName)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
//google()
google() // Google's Maven repository
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
// classpath 'com.google.gms:google-services:4.3.2'
// classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
// google()
google() // Google's Maven repository
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
What am I missing or what have I added that is incorrect?
Please help me solve This is my error.
Check the official guide:
In your top-level file you have to add the google play service plugin com.google.gms:google-services:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.3.2'
}
}
Cannot resolve external dependency com.google.gms:google-services:4.2.0 because no repositories are defined.
I have tried a lot of solutions from Stack Overflow but not a single solutions that i mentioned worked for me
Here is my project level build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and here is my app level build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.rsolveapp"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-storage:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.google.firebase:firebase-analytics:17.0.1'
}
buildscript {
dependencies {
classpath 'com.google.gms:google-services:4.2.0'
}
}
After the program sync it gives me this error "Cannot resolve external dependency com.google.gms:google-services:4.2.0 because no repositories are defined."
I have faced a similar problem and I solved it by adding,
repositories {
google()
jcenter()
}
To the buildscript in build.gradle(Module:app) file. Have a nice day
try adding following in "app" level gradle file
repositories {
mavenCentral()
}
Add the following snippet in build.gradle app level
repositories {
google()
jcenter()
}
like for example
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.3'
}
}
I'm not able to build my project in Android Studio. I'm trying to use the google vision API for face detection and it worked fine so far, but I can't clean/ build my project because of this
This is my build error message
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not determine artifacts for com.google.android.gms:play-services-vision:18.0.0
Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-vision/18.0.0/play-services-vision-18.0.0.aar'.
Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-vision/18.0.0/play-services-vision-18.0.0.aar'.
Remote host closed connection during handshake
SSL peer shut down incorrectly
This my build.gradle file (app level)
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.example.facedetect"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.android.volley:volley:1.1.1'
implementation "com.github.bumptech.glide:glide:4.9.0"
implementation 'com.github.bumptech.glide:glide:4.9.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
implementation 'com.google.android.gms:play-services-vision:18.0.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.mindorks:paracamera:0.2.2'
}
apply plugin: 'com.google.gms.google-services'
Project level build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:4.3.0'
}
}
When I remove the
implementation 'com.google.android.gms:play-services-vision:18.0.0
The project build succeeds. Is something wrong with the way I'm adding the dependency?
I think you have problem with your dependency classpath. You created two buildscript dependencies. Instead, you can include one or more plugins (dependency) in same buildscript.
You can have root build.gradle as below:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.3.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Also, you don't have to write google maven url maven { url 'https://maven.google.com'} separately, since google() will do the same thing for you.
I figured it out. Looks like I needed to invalidate caches and restart both android studio and my computer. Thanks for the help!
I am trying to create a simple Android application. I have the latest version of Android Studio and i think both my gradle build files are correct.
I have placed
implementation 'com.google.android.gms:play-services-maps:11.2.0'
in app gradle dependencies.
Due to this I get the following error:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.google.android.gms:play-services-maps:11.2.0.
I have looked at various links and tried out proposed solutions but none have worked for me.
Below are both my gradle build files.
project build.gradle:
//Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://repo.situm.es/artifactory/libs-release-local" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "demo.situm.situmapp"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
//testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
matchingFallbacks = ['release', 'debug']
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services-maps:11.2.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'
}
//apply plugin: 'com.google.gms.google-services'
Hope you can help.
Thanks,
Kabir
try this i found:
Failed to resolve com.google.android.gms play-services-auth:11.2.0
Add maven to your root level build.gradle file
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
This maven repo is required starting from 11.2.0.
Or add google() repository to your "build.gradle" file. This gradle method is equivalent to
maven { url "https://maven.google.com" }.
repositories {
jcenter()
google()
}
I started a new app in Kotlin, but when Android Studio finished to build the new project, etc.. is says that cand download the correct version of Kotlin:
Here is the build gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.4-eap-77'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and the app gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.xxxxxx.xxxxxx"
minSdkVersion 20
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.android.support:design:26.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.0'
}
How can I fix it to allow download the correct version?
To use a EAP version of the kotlin plugin you have to add the repo in the buildscript block
maven {
url 'https://dl.bintray.com/kotlin/kotlin-eap-1.1'
}
Something like:
buildscript {
ext.kotlin_version = '1.1.4-eap-77'
repositories {
google()
jcenter()
maven {
url 'https://dl.bintray.com/kotlin/kotlin-eap-1.1'
}
}
//...
}
Also you should add the same maven repo to repository block to download the kotlin dependencies.
Something like:
repositories {
google()
jcenter()
maven {
url 'https://dl.bintray.com/kotlin/kotlin-eap-1.1'
}
}
You can find more info here.