Android - Getting multiple errors while building the project - android

I am getting these errors while building the project
Failed to resolve: firebase-core
Failed to resolve: multidex
Failed to resolve: play-services-ads
Failed to resolve: play-services-auth
Failed to resolve: firebase-auth-license
Failed to resolve: common
Please check and let me know how this issue can be resolved?
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.test.android"
minSdkVersion 15
targetSdkVersion 26
versionCode 3
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "65f11821-8462-4ec4-9e41-XXXXXXXX",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "91629XXXXX00"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// applovin
implementation project(':unity-ads')
//unity ads
//compile 'com.google.android.gms:play-services-ads:11.0.4'
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support:support-vector-drawable:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.+'
implementation 'com.google.android.gms:play-services:11.6.0'
implementation 'com.android.support:multidex:1.0.1'
//compile 'com.github.cooltechworks:ScratchView:v1.1'//not used
implementation 'com.jackpocket:scratchoff:1.1.0'
implementation 'com.adcolony:sdk:3.2.1'
implementation 'com.android.support:support-annotations:26.0.1'
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.facebook.android:facebook-share:[4,5)'
testImplementation 'junit:junit:4.12'
implementation 'com.ironsource.sdk:mediationsdk:6.7.0.1#jar'
//compile 'com.google.ads.mediation:unity:2.1.1.0' //not used
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.github.bumptech.glide:glide:4.1.1'
implementation 'commons-net:commons-net:3.3'
//get server time
//compile 'com.github.instacart.truetime-android:library-extension-rx:2.0'
//compile 'com.github.instacart.truetime-android:library:2.0' // not used
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-core:11.6.0'
implementation 'com.google.android.gms:play-services-auth:11.6.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
implementation files('libs/applovin-sdk-7.7.0-javadoc.jar')
implementation files('libs/applovin-sdk-7.7.0.jar')
}
apply plugin: 'com.google.gms.google-services'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha09'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Apparently, jcenter has started mirroring Google's repo. Try moving google() before jcenter() in the allprojects section of your project's build.gradle (like this):
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
}

Have you tried rebuilding the app? Also make sure you are using the latest version of GMS. As a sidenote you dont need to add the entire gms library, you can add selective services. I see you have added gms- and gms-ads, which would already be included in the main gms.

Related

AndroidError : Program type already present : android_serialport_api.SerialPort when I try generate Signed APK from Android Studio

I am getting specified exception after adding .aar file to app gradle:Program type already present: android_serialport_api.SerialPort
When I try to build Debug APK it is working but When I try to build Signed APK it is giving specified exception
Below is my app-gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "XX.XX.XX"
minSdkVersion 22
targetSdkVersion 28
versionCode 27
versionName "6.6"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
useProguard true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
configurations {
all*.exclude group: 'com.squareup.okhttp3';
all*.exclude group: 'com.squareup.okio';
}
}
repositories {
maven { url "jitpack.io" }
maven { name 'glide-snapshot'; url 'oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
}
dependencies {
implementation files('libs/apache-httpcomponents-httpclient.jar')
implementation files('libs/apache-httpcomponents-httpcore.jar')
implementation files('libs/commons-codec-1.11.jar')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.journeyapps:zxing-android-embedded:3.5.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.google.android.gms:play-services-location:11.0.4'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
implementation 'com.jakewharton.timber:timber:4.5.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'me.dm7.barcodescanner:zxing:1.8.4'
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.github.antonKozyriatskyi:CircularProgressIndicator:1.3.0'
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
//implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.54'
implementation 'com.google.android.gms:play-services-maps:11.0.4'
/*implementation(name: 'merchantsdk', ext: 'aar')*/
/*implementation(name: 'merchantsdk', ext: 'aar'){
exclude module: 'SerialPort'
}*/
/*implementation(name: 'ezetapandroidsdk', ext: 'aar')*/
implementation project(':merchantsdk')
implementation project(':ezetapandroidsdk')
testImplementation 'junit:junit:4.12'
implementation files('libs/org.apache.commons.io.jar')
}
apply plugin: 'com.google.gms.google-services'
Below is the Project gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven { url "https://jcenter.bintray.com"}
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://jitpack.io'
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Below is the exception
> Task :app:transformClassesAndResourcesWithR8ForRelease FAILED
AGPBI: {"kind":"error","text":"Program type already present: android_serialport_api.a","sources":[{}],"tool":"R8"}
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithR8ForRelease'.
> com.android.tools.r8.CompilationFailedException: Compilation failed to complete
Debug apk is working fine but when I try to build signed APK giving above exception.
Please help me on this.Thanks in advance.
The issue is that you have more that one package using android_serialport_api.SerialPort.
There is 2 ways of dealing with this. The first is going through each library and checking if it's using it or you can find duplicates by running:
gradlew -q dependencies yourProject:dependencies --configuration implementation
You can also exclude it from your merchantsdk, like this:
implementation(name: 'merchantsdk', ext: 'aar'){
exclude module: 'SerialPort'
}

How to Avoid Conflict in Android Gradle Dependencies

I am new in android and working on an old Android project. It has a Google Places Autocomplete feature which is not working currently as Place SDK for Android it used is deprecated currently. without this everything is working fine but when i am trying to add this places sdk implementation 'com.google.android.libraries.places:places:1.0.0' for auto complete place feature then gradle sync successfully but when try to run the app then it shows error on all xml files as resource linking fails or duplicate value for resource 'attr/font' with config ' etc etc. My question how I can use this sdk without disturbing others. Below is my App level Gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
//buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.myappo"
minSdkVersion 16
targetSdkVersion 25
versionCode 27
versionName "1.5"
manifestPlaceholders = [HOCKEYAPP_APP_ID: "51a9c4471559421b8d53a07cbb3e3fa0"]
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
lintOptions { checkReleaseBuilds false }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
//incremental true
}
repositories {
jcenter()
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
useLibrary 'org.apache.http.legacy'
}
allprojects {
repositories {
google()
}
repositories {
maven {
url 'https://maven.google.com'
}
}
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:25.3.1'
implementation 'com.android.support:design:25.1.0'
implementation 'com.google.maps.android:android-maps-utils:0.4'
implementation 'com.google.android.gms:play-services:10.0.1'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.hbb20:ccp:1.7.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'net.hockeyapp.android:HockeySDK:4.1.3'
implementation 'com.android.support:recyclerview-v7:25.1.1'
implementation 'com.android.support:cardview-v7:25.1.1'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.facebook.android:facebook-android-sdk:4.0.0'
implementation 'com.google.firebase:firebase-messaging:9.6.0'
implementation 'com.google.code.gson:gson:2.7'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.github.krtkush:LinearTimer:v2.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.bumptech.glide:glide:3.6.1'
implementation 'com.iarcuschin:simpleratingbar:0.1.5'
implementation 'com.paypal.sdk:paypal-android-sdk:2.15.3'
testImplementation 'junit:junit:4.12'
implementation 'com.google.android.libraries.places:places:1.0.0' // this is creating problem
}
apply plugin: 'com.google.gms.google-services'
And this is Project level Gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
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 {
jcenter()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
remove bracket from this implementation ("com.google.android.libraries.places:places:1.0.0")
Migrate your project to Android X which is the best solution to prevent the dependency conflict
Migrate to AndroidX

ClassNotFoundException: unable to find class "android.support.v4.util.ArrayMap"

The signed apk of my app runs on the android versions higher than 5.0.1 but I am facing this issue that my app crashes immediately after launching the app on version 5.0.1 and this is the error I get -
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.*****1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
please note that the app is not crashing when I run using android studio but it crashes when I run the signed apk.
I don't know what to do, I have gone through a lot of stackoverflow questions but found nothing that can solve my issue. This is my app.gradle file -
**buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' } // for crashlytics
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "*****"
minSdkVersion 21
targetSdkVersion 26
flavorDimensions "default"
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
versionCode 3
multiDexEnabled true
versionName "1.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
android {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
dexOptions {
javaMaxHeapSize "2g"
}
}
repositories {
mavenCentral()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//google 's library
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:design:26.0.2'
implementation 'com.android.support:support-v4:26.0.2'
implementation 'com.android.support:support-v13:26.0.2'
implementation 'com.android.support:cardview-v7:26.0.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.android.gms:play-services-vision:11.8.0'
//for barcode generation
implementation 'com.google.zxing:core:3.2.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
compile 'me.dm7.barcodescanner:zxing:1.9'
compile 'com.journeyapps:zxing-android-embedded:3.0.2#aar'
//multidex support
compile 'com.android.support:multidex:1.0.1'
//for fancy dialogs
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services:11.8.0'
compile 'com.geniusforapp.fancydialog:FancyDialog:0.1.4'
//for home screen carousal view
compile 'com.synnapps:carouselview:0.1.4'
//for bottom navigation
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
//for shaping the image view
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.jackandphantom.android:circularimageview:1.2.0'
//libraries for retrofit and conversion factory GSON
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
//FilePicker Library
compile 'com.droidninja:filepicker:2.0.8'
//for welcome screen
compile 'com.stephentuso:welcome:1.4.1'
compile 'com.squareup.okhttp3:okhttp:3.9.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.0.1'
compile 'com.squareup.retrofit2:converter-scalars:2.3.0'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
//material calender picker
compile 'com.wdullaer:materialdatetimepicker:3.4.0'
implementation 'com.trello:rxlifecycle:1.0'
implementation 'com.trello:rxlifecycle-components:1.0'
compile 'com.polidea.rxandroidble:rxandroidble:1.4.3'
implementation 'com.android.support:design:26.0.2'
compile 'io.reactivex.rxjava2:rxjava:2.0.7'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
//libraries for firebase integration
//for analytics
compile 'com.google.firebase:firebase-core:11.8.0'
//for cloud messenging
compile 'com.google.firebase:firebase-messaging:11.8.0'
//for circular indicator
compile 'com.github.lzyzsd:circleprogress:1.2.1'
compile 'me.biubiubiu.justifytext:library:1.1'
implementation files('libs/imagecapture.jar')
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
}
apply plugin: 'com.google.gms.google-services'**
This is my build.gradle (project level)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.0'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If the gradle version is 3.x.x try to add maven { url 'https://maven.google.com' } to
allprojects {
repositories {
//add here
}
}
instead of google() and sync gradle. It should help. You can see difference between them using this link.
I found the solution. I tried building the Signed apk for both the signature versions V1(jar signature) and V2(full apk signature) and it worked.

Could not find any version that matches com.google.android.gms:play-services:[15.0.0, 16.0.0)

i use firebase and onesignal , but when opening project give me the error ,
i update build-tools , sdk tools and google play services.
Error:Unable to resolve dependency for ':app#debug/compileClasspath': Could not find any version that matches com.google.android.gms:play-services:[15.0.0, 16.0.0).
Open FileShow Details
Error:Unable to resolve dependency for ':app#release/compileClasspath': Could not find any version that matches com.google.android.gms:play-services:[15.0.0, 16.0.0).
Open FileShow Details
build.gradle(project)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
url 'https://dl.bintray.com/drummer-aidan/maven'
}
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
build.gradle(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'
android {
compileSdkVersion 27
defaultConfig {
applicationId "ir.tethys.app"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [
onesignal_app_id : '811bb48c-2350-455d-aa7d-63eea30e226e',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: '845923319180'
]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
buildToolsVersion '28.0.2'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.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.android.support:design:27.1.1'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.nabinbhandari.android:permissions:3.5'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.afollestad:easyvideoplayer:0.3.0'
implementation 'com.zarinpal:purchase:0.0.3-beta'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
implementation project(':infinitescrollprovider')
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.android.gms:play-services:12.0.1'
}
apply plugin: 'com.google.gms.google-services'
Try adding maven { url "https://maven.google.com" } to your root level build.gradle file like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
You can also do it like this if your version of Gradle plugin supports it:
allprojects {
repositories {
google()
jcenter()
}
}

Facing several errors while building the project in Android [duplicate]

This question already has answers here:
Android - Getting multiple errors while building the project
(2 answers)
Closed 4 years ago.
I am getting these errors after importing the android project
Failed to resolve: firebase-core
Open File
Failed to resolve: multidex
Open File
Failed to resolve: play-services-ads
Open File
Failed to resolve: play-services-auth
Open File
Failed to resolve: firebase-auth-license
Open File
Failed to resolve: common
Show in File
I am unable to know the exact reason of this issue. Please check.
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha09'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app level build.gradle
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.test.android"
minSdkVersion 15
targetSdkVersion 26
versionCode 3
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "65f11821-8462-4ec4-9e41-XXXXX",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "916XXXXXXX00"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// applovin
implementation project(':unity-ads')
//unity ads
//compile 'com.google.android.gms:play-services-ads:11.0.4'
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support:support-vector-drawable:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.+'
//implementation 'com.google.android.gms:play-services:11.6.0'
implementation 'com.android.support:multidex:1.0.1'
//compile 'com.github.cooltechworks:ScratchView:v1.1'//not used
implementation 'com.jackpocket:scratchoff:1.1.0'
implementation 'com.adcolony:sdk:3.2.1'
implementation 'com.android.support:support-annotations:26.0.1'
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.facebook.android:facebook-share:[4,5)'
testImplementation 'junit:junit:4.12'
implementation 'com.ironsource.sdk:mediationsdk:6.7.0.1#jar'
//compile 'com.google.ads.mediation:unity:2.1.1.0' //not used
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.github.bumptech.glide:glide:4.1.1'
implementation 'commons-net:commons-net:3.3'
//get server time
//compile 'com.github.instacart.truetime-android:library-extension-rx:2.0'
//compile 'com.github.instacart.truetime-android:library:2.0' // not used
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-core:11.6.0'
implementation 'com.google.android.gms:play-services-auth:11.6.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
implementation files('libs/applovin-sdk-7.7.0-javadoc.jar')
implementation files('libs/applovin-sdk-7.7.0.jar')
}
apply plugin: 'com.google.gms.google-services'
EDIT: Unfortunately, I've belatedly realized that this question was a duplicate. Please refer to the answer here instead. (I'm also leaving this duplicate answer text here for now - although it will probably eventually be deleted - to preserve the solution that the original poster marked as correct.)
Apparently, jcenter has started mirroring Google's repo. Try moving google() before jcenter() in the allprojects section of your project's build.gradle (like this):
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
}
Try another version of this APIs. And you should to declare constant version and use it like {$const} then your gradle will be less error prone about versions difference.

Categories

Resources