I have a weird error on my android apps that lead them to crashes.
Basically, when I install an application from android studio directly to my smartphone nothing happens and everything works fine. I have tested it on 3 different devices and the applications work properly. But when it comes to installing these apps from the google play store some of them won't even be able to start.
The error I got from the report is the following:
java.lang.VerifyError:
at com.google.firebase.platforminfo.LibraryVersion.create (LibraryVersion.java)
at com.google.firebase.platforminfo.LibraryVersionComponent.create (LibraryVersionComponent.java)
at com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar.getComponents (AnalyticsConnectorRegistrar.java)
at com.google.firebase.components.ComponentRuntime.discoverComponents (ComponentRuntime.java)
at com.google.firebase.components.ComponentRuntime.<init> (ComponentRuntime.java)
at com.google.firebase.components.ComponentRuntime.<init> (ComponentRuntime.java)
at com.google.firebase.components.ComponentRuntime$Builder.build (ComponentRuntime.java)
at com.google.firebase.FirebaseApp.<init> (FirebaseApp.java)
at com.google.firebase.FirebaseApp.initializeApp (FirebaseApp.java)
at com.google.firebase.FirebaseApp.initializeApp (FirebaseApp.java)
at com.google.firebase.FirebaseApp.initializeApp (FirebaseApp.java)
at com.google.firebase.provider.FirebaseInitProvider.onCreate (FirebaseInitProvider.java)
at android.content.ContentProvider.attachInfo (ContentProvider.java:1940)
at android.content.ContentProvider.attachInfo (ContentProvider.java:1915)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo (FirebaseInitProvider.java)
at android.app.ActivityThread.installProvider (ActivityThread.java:6742)
at android.app.ActivityThread.installContentProviders (ActivityThread.java:6289)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6204)
at android.app.ActivityThread.access$1200 (ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1785)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:214)
at android.app.ActivityThread.main (ActivityThread.java:7050)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)
Lately I have made some changes in the gradle files updating the versions of different libraries. Here are my gradle files:
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.aaa.bbb"
minSdkVersion 21
targetSdkVersion 30
multiDexEnabled true
versionCode 26
versionName "2.0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
//proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// Enables code shrinking, obfuscation, and optimization for only
// your project's release build type.
minifyEnabled true
// Enables resource shrinking, which is performed by the
// Android Gradle plugin.
shrinkResources true
// Includes the default ProGuard rules files that are packaged with
// the Android Gradle plugin. To learn more, go to the section about
// R8 configuration files.
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.ads.mediation:unity:3.7.5.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.gms:play-services-ads:20.3.0'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'joda-time:joda-time:2.10.6'
implementation 'com.squareup.okhttp3:okhttp:3.12.10'
implementation platform('com.google.firebase:firebase-bom:28.3.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-messaging-directboot'
implementation 'org.shredzone.commons:commons-suncalc:3.3'
implementation 'com.github.jesgs:moonfx:v1.0.1'
implementation 'com.google.android.ump:user-messaging-platform:2.0.0'
implementation 'com.facebook.android:facebook-android-sdk:8.1.0'
implementation 'com.google.ads.mediation:adcolony:4.5.0.0'
implementation 'com.google.android.play:core:1.10.0'
implementation 'jp.hitting.review-manager:review-manager:0.0.1'
implementation 'com.google.android.ads.consent:consent-library:1.0.8'
}
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 {
google()
jcenter()
mavenCentral()
maven {
url "https://adcolony.bintray.com/AdColony"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I really don't understand where the problem is. It seems to be caused by firebase but I don't know how to replicate the issue during development and fix it.
Related
I can’t understand why the code stopped working correctly after being published in the Google market in the release branch.
Step 1. Problem of the following character: 1. Turn on "minifyEnabled true", configure the proguard-rules.pro file. I write there the names of classes whose code does not need to be changed (-keep public class myClassName ...)
I check all this on the local computer - everything works (As you can see, the same settings for both release and debug)
I upload to the Google market - a branch of internal testing. Does not work.
Step 2. Turn off "minifyEnabled false".
I upload the code to the Google market in the internal testing branch. Surprisingly, everything works.
Ok, I'm trying to copy the current version from the internal branch to the release branch.
And, after the publication, this version of the application does not work again.
First, I have "minifyEnabled" turned off, but the app behaves like it's enabled. The application also starts to crumble in other places because of the encrypted variables, nonsense is passed to my functions and because of this they break.
Although I also have a "proguard-rules.pro" file with the rules configured correctly.
Step 3. I repeated step 2, only uploaded directly to the release branch, everything is exactly the same. Doesn't want to work.
Files:
plugins {
id 'com.android.application'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
// Apply the Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'
repositories {
mavenCentral()
}
android {
compileSdkVersion 33
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.my.app"
minSdkVersion 23
targetSdkVersion 33
versionCode 40
versionName "1.0"
setProperty("archivesBaseName", applicationId + "-v" + versionCode + "(" + versionName + ")")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
packagingOptions {
resources {
excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/license.txt', 'META-INF/NOTICE', 'META-INF/NOTICE.txt', 'META-INF/notice.txt', 'META-INF/ASL2.0']
}
}
namespace 'com.my.app'
}
dependencies {
//firebase auth
implementation platform('com.google.firebase:firebase-bom:29.1.0')
implementation 'com.google.firebase:firebase-auth:21.1.0'
// google
implementation 'com.google.android.play:core:1.10.3'
implementation 'com.google.android.gms:play-services-games:23.0.0'
implementation 'com.google.android.gms:play-services-auth:20.3.0'
//firebase-crashlytics
implementation 'com.google.firebase:firebase-crashlytics:18.3.1'
implementation 'com.google.firebase:firebase-analytics:21.2.0'
//google billing
implementation "com.android.billingclient:billing:5.0.0"
implementation "com.android.volley:volley:1.2.1"
//default
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.nex3z:flow-layout:1.3.3'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'org.jetbrains:annotations:16.0.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
//JUnit 4 Test
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "androidx.lifecycle:lifecycle-viewmodel:2.5.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
}
next file:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1'
}
}
allprojects {
repositories {
mavenCentral()
google()
}
task clean(type: Delete) {
delete rootProject.buildDir
}
proguard-rules.pro file:
-keep public class myClassName
Whenever I run the app for the first time, I get the following exception
com.mypckg.myapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mypckg.myapp, PID: 6460
android.content.res.Resources$NotFoundException: Resource ID #0x20c0016
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:237)
at android.content.res.Resources.getInteger(Resources.java:1127)
at org.chromium.ui.base.DeviceFormFactor.isTablet(chromium-TrichromeWebViewGoogle.aab-stable-438907233:2)
at Vm.a(chromium-TrichromeWebViewGoogle.aab-stable-438907233:2)
at Lc.run(chromium-TrichromeWebViewGoogle.aab-stable-438907233:3)
at org.chromium.content.browser.BrowserStartupControllerImpl.e(chromium-TrichromeWebViewGoogle.aab-stable-438907233:10)
at org.chromium.content.browser.BrowserStartupControllerImpl.g(chromium-TrichromeWebViewGoogle.aab-stable-438907233:7)
at t6.run(chromium-TrichromeWebViewGoogle.aab-stable-438907233:20)
at org.chromium.base.ThreadUtils.f(chromium-TrichromeWebViewGoogle.aab-stable-438907233:2)
at sp0.j(chromium-TrichromeWebViewGoogle.aab-stable-438907233:32)
at rp0.run(chromium-TrichromeWebViewGoogle.aab-stable-438907233:2)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Then when I open the app for the second,third time, it works fine.
I am guessing this might be due to some libraries, so here is my app.gradle file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
compileSdkVersion 29
buildToolsVersion "30.0.1"
defaultConfig {
applicationId "com.mypckg.myapp"
minSdkVersion 19
targetSdkVersion 29
versionCode 16
versionName "1.0.17"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", "MyApp"+ versionName +"_"+new Date().format( 'yyyy-MM-dd HH:mm' ))
}
buildTypes {
debug {
buildConfigField "String", 'BASE_URL', '"https://baseurl.com/"'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
buildConfigField "String", 'BASE_URL', '"https://baseurl.com/"'
}
}
viewBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
dependencies {
def room_version = '2.2.6'
def retrofitVersion = '2.8.1'
def okhttpVersion = '4.5.0'
def daggerVersion = '2.31.2'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.material:material:1.4.0-alpha01'
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-rxjava2:$room_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0"
implementation 'androidx.fragment:fragment-ktx:1.3.0'
implementation "com.github.doyaaaaaken:kotlin-csv-jvm:0.11.0"
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttpVersion"
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation "com.google.dagger:dagger:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
implementation "com.google.dagger:hilt-android:2.31.2-alpha"
kapt "com.google.dagger:hilt-android-compiler:2.31.2-alpha"
implementation 'androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03'
kapt 'androidx.hilt:hilt-compiler:1.0.0-alpha03'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
implementation 'com.github.quickpermissions:quickpermissions-kotlin:0.4.0'
implementation 'com.facebook.android:audience-network-sdk:5.10.0'
implementation platform('com.google.firebase:firebase-bom:26.6.0')
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.4'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
}
and this is my project level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.31"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.28-alpha'
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "http://jitpack.io/" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Any help would be highly appreciated. Thanks
This issue was also mentioned in Samsung Developer Forum, but no solution offered. See https://forum.developer.samsung.com/t/android-content-res-resources-notfoundexception-in-org-chromium-ui-base-deviceformfactor-istablet/17544/4
Is there any more information on this issue? I see it in my app too. Initially I saw it ONLY on Samsung S21 phones with Android 12, now I got also a crash report on Crashlytics on one Pixel 3 phone with Android 12, and several on Samsung S21 with Android 11… It happens most often on this call:
String uas = WebSettings.getDefaultUserAgent(context);
I suspect that it happens only if called when no WebView control was created yet, as so far I did not find crashes from similar calls later in the app, when the control was created in it. Surrounding this line with try - catch does not help, as the crash seems to happen in another thread.
Greg
I have the same issue,
due I move MobileAds.initialize from the Application class to another class.
You can try to init MobileAds.initialize at Application class
I an trying to import Ksoap2 library in android studio using .jar file version 3.6.4. I have successfully implemented the jar file to android studio. However, on the module app activity when I try to import e.g. import "org.ksoap2.SoapEnvelope;", it gets and error it shows following results:
Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.google.code.ksoap2-android:ksoap2-android:3.6.4.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/google/code/ksoap2-android/ksoap2-android/3.6.4/ksoap2-android-3.6.4.pom
- https://dl.google.com/dl/android/maven2/com/google/code/ksoap2-android/ksoap2-android/3.6.4/ksoap2-android-3.6.4.pom
- https://jcenter.bintray.com/com/google/code/ksoap2-android/ksoap2-android/3.6.4/ksoap2-android-3.6.4.pom
Required by:
project :app
Possible solution:
Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Also the imports library have error, please see the pic:
Here is the Build.gradle module code:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is Build.gradle(app) Module code:
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.kowloondairycompanykdl.milk_ic"
minSdkVersion 27
targetSdkVersion 30
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 JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation files('libs\\ksoap2-android-assembly-3.6.4.jar')
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.4'
}
Please help me, I been stuck here for a long time. How to fix the error and how can I implement the Ksoap2 library properly. Thanks
There doesn't seem to be a 3.4.3 version of that library. There's a 3.4.0. And the newest is 3.6.4. You're going to need to use one of those. I'd move to 3.6.4 as 3.4.0 is over 5 years old, and likely lacks security updates.
Remove the dependencyResolutionManagement block from the setting.gradle file to have your project work the old way.
Related issue: Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'
I am using Firebase for uplodaing the images but whenever i am using StorageReference then it saying cannot able to resolve this symbol i have tried to add dependency of storage but it is also not adding and giving me the error.
Please tell how can i use StorageReference
my build.gradle(app):
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "example.example1.adminshayariapp"
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'
implementation 'com.google.firebase:firebase-database:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.squareup.picasso:picasso:2.71828'
}
build.gradle(Project):
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.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
}
Please tell what is wrong why i am not able to use StorageReference.
If you are planning on using the Storage Bucket feature from Firebase I notice you are missing some implementations in your App Gradle:
implementation 'com.google.firebase:firebase-storage:19.1.1'
implementation 'com.google.firebase:firebase-auth:19.3.1'
You might not need the second one, but i would recommend authentication anyway. Go ahead and add these into your dependencies, that should solve the issue. If it persists let me know and I'll give it a second look.
Also ensure that you have connected your app to your Firebase project...
In android studio, if you go to tools(top bar) > FireBase > Storage it will guide you through the installation, and ensure that you have all the dependencies you need.
I've been going at this for a while now, and it's driving me insane. I've looked through a few existing Stack Overflow questions, but nothing has worked. I keep getting this error whenever I add the last line, which I need for my AdMob ad units. People seem to solve this issue by changing the version number for this line to 15.0.0, but, as you can see, I've already done this. Please help, if you can. Also, this isn't even the first time I've worked with ad units.
Build.gradle (App level)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.coincalc.anduril.sharetale"
minSdkVersion 17
targetSdkVersion 26
versionCode 2
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-vector-drawable:26.1.0'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'
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'
compile 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
}
apply plugin: 'com.google.gms.google-services'
Build.gradle (Project level)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:3.3.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://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Update the following classpath dependency in your top-level build.gradle:
classpath 'com.google.gms:google-services:4.0.1'
Only newer versions of this plugin understand that the new Firebase dependencies no longer all have to be at the same version.
Read this for more information.
Upgrade your firebase dependencies to latest version, by changing your dependencies to this:
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com. google.firebase:firebase-core:16.0.1'
And in your project level Gradle file, increment your Google services plugin to 4.0.0
Change this:
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'
compile 'com.google.firebase:firebase-core:12.0.1'
into this:
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
Check this for more info:
https://firebase.google.com/support/release-notes/android