I have this code on my gradle file but I have an error which says
"mixing versions can lead to runtime crashes"
I made this project using the assistant of android studio
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
}
Try updating your 'com.google.firebase:firebase-core:16.0.1' to '16.0.6'. It's the most up-to-date version.
Related
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-auth:16.0.5'
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.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Android support libraries are now replaced by androidX. I recommend you use this new approach if you are starting a new project or migrate if you are on a previous project as support libraries are now deprecated and no longer maintained. AndroidX
Including android design library to the dependencies causes app to crash.
Im launching this on Nexus S emulator with 25 API. All my libraries are of the same version, so I don't know what's the problem.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0' //this one
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:28.0.0' // For CardView
implementation 'com.android.support:recyclerview-v7:28.0.0'
}
Migrate your code to AndroidX, the new SDK dependency dir structure will help you avoid such problems now and in the future.
I am using FirebaseUI to try out the RecyclerViewAdapter. When I try to run the app the gradle build doesn't succeed and gives these errors:
Errors shown by Gradle
This doesn't happen when I take out the FirebaseUI Dependency.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.firebaseui:firebase-ui-database:4.1.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'}
Edit: I added MultiDex Support as mentioned on Android Developers Site
What should I do to make the build successful and run the app.
Thanks in advance.
These are the dependencies:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:27.1.1'
}
When I add implementation 'com.facebook.android:facebook-android-sdk:4.0.1' then it "breaks" implementation 'com.android.support:appcompat-v7:27.1.1' with the error: All com.android.support libraries must use the exact same version specification
Some answers from All com.android.support libraries must use the exact same version specification suggest that I have to look at all the libraries but I can't see what's wrong here:
Can someone explain it? I'm complete newbie in android and I must say it's a horrendous mess
Try use implementation 'com.facebook.android:facebook-android-sdk:4.35.0'
I am trying to integrate admob ad in my app but I am getting some red line under one of my dependencies code.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
**implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'**
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
while adding
implementation 'com.google.android.gms:play-services-ads:15.0.0'
I am getting red line under
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
Where am I going wrong?
Try to downgrade the appcombat version to:
implementation 'com.android.support:appcompat-v7:27.1.1'
See more here.