I'm working with old version of appcompat, but error after migrate to androidX.
implementation 'com.android.support:appcompat-v7:28.0.0'
Should i use implementation instead of runtimeOnly ?
After androidx migration your dependency would have been changed to following:
implementation "androidx.appcompat:appcompat:1.5.1"
If above is already present in your build.gradle then you can safe remove appcompat-v7 dependency.
As far as using implementation or runtimeOnly it totally depends upon dependency usage. If its usage in compile time then use implementation or if this just require in runtime use runtimeOnly.
To get your answer please refer to the link: Dependency configurations
According to the description mentioned in above link:
Related
I am getting error: package android.arch.lifecycle does not exist and i tried to resolve it,
i used below links : but none of these resolve it:
Failed to resolve: android.arch.lifecycle:extensions:1.0.0-alpha1 android studio 3.0
Could not resolve android.arch.lifecycle:extensions:1.1.0
i have below dependencies :
// Room components
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
androidTestImplementation "android.arch.persistence.room:testing:$rootProject.roomVersion"
// Lifecycle components
implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion"
annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion"
Recently I got this link:
https://developer.android.com/jetpack/androidx/releases/lifecycle#java
which says : The APIs in lifecycle-extensions have been deprecated. Instead, add dependencies for the specific Lifecycle artifacts you need.
Does this mean now I need to use individual packages?
The android.arch packages have been deprecated, try using androidx packages instead. Also make sure you've added google() in your build.gradle.
Finally i got the answer.
android.support is deprecated , i migrated to androidx via following links:
https://medium.com/androiddevelopers/migrating-to-androidx-tip-tricks-and-guidance-88d5de238876
https://developer.android.com/jetpack/androidx/migrate
And at last if you get error like buttler knife/ (or any third party lib) not resolved, find android x compatible version
i used:
// butter knife
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
How can I import androidx design dependency
I have tried to import : implementation 'androidx.design:design:1.0.2'
app compact version is : implementation 'androidx.appcompat:appcompat:1.0.2'
I have got this error -
ERROR: Failed to resolve: androidx.design:design:1.0.2
try this:
implementation 'com.google.android.material:material:1.0.0'
To know equivalent for new Androidx Artifacts from old build artifacts, please refer the below link
https://developer.android.com/jetpack/androidx/migrate/artifact-mappings
note: answer by Poyyamozhi Ramakrishnan is correct and I posted my answer for better understanding.
implementation 'com.google.android.material:material:1.2.0-alpha02'
Just copy paste this one in to your dependencies.
There is no design library in androidx. It uses material library. Get more info at
this
implementation 'com.google.android.material:material:1.2.0-alpha06'
Try this latest dependency.
Try this: 'com.google.android.material:material-rc01'
Currently we have a lot of firebase version.
firebase_core_version = '16.0.6'
firebase_perf_version = '16.2.2'
firebase_messaging_version = '17.3.4'
...
implementation "com.google.firebase:firebase-core:$firebase_core_version"
implementation "com.google.firebase:firebase-perf:$firebase_perf_version"
implementation "com.google.firebase:firebase-messaging:$firebase_messaging_version"
...
But they each have different version number and sometimes they are conflicting or resolved to unexpected versions by transitive includes. Or other module declares different version for same library... That steals my time.
Is there any solutions for this?
Gradle has "BoM" feature that is available from 5.0. and it enables you free from version hell.
implementation platform('com.google.firebase:firebase-bom:20.0.1')
implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-appindexing'
implementation 'com.google.firebase:firebase-config'
You may notice that only new import firebase-bom has version and any other libraries don't have version.
This is because BoM dependency contains all firebase version inside it (of course they are compatible!).
So your module always import firebase-bom then version conflict will be gone.
firebase-bom is currently experimental but it works for me.
https://firebase.google.com/docs/android/setup#firebase-bom
I hope androidx (jetpack) also have this!
There is also okhttp-bom available.
https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp-bom
I'm building a library with jitpack.io I was able to build and compile into the application successfully, but the problem here is that in the library there includes a number of other libraries compiled into
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.facebook.android:audience-network-sdk:4.99.1'
implementation 'com.appnext.sdk:banners:2.4.2.472'
implementation 'com.appnext.sdk:ads:2.4.2.472'
implementation 'com.appnext.sdk:native-ads2:2.4.2.472'
implementation 'org.jsoup:jsoup:1.11.3'
so when I compiled the library into my application and called it, it reportedly did not find the class I was including into libraries(org.jsoup., com.appnext., ..). If I want to use I have to re-declare the libraries on again in my application. Is there a way to not do this, as includes the library inside
I was facing the same issue and apparently it's a bug in maven gradle plugin v1.5; problem solved after my plugin version is updated to 2.1.
Issue: https://github.com/dcendents/android-maven-gradle-plugin/issues/61
Related Answer: https://stackoverflow.com/a/51190164/1640033
Hi i'am trying to import the new android support library like this com.android.support:support-design:22.0.0 but i got this error after sync the gradle : failed to find
You have to update your Android Support Repository in SDK Manager, then just add this dependency to your build.gradle:
compile 'com.android.support:design:22.2.0'
com.android.support:support-design:22.0.0 is wrong.
dependencies {
implementation 'com.android.support:design:28.0.0'
}
New Android Design Libraries usually start with androidx word, such as:
AppCompat androidx:
implementation 'androidx.appcompat:appcompat:1.2.0'
CardViex androidx:
implementation 'androidx.cardview:cardview:1.0.0'
However be careful because everything is not start with androidx. For example, old design dependency is:
implementation 'com.android.support:design:28.0.0'
But new design dependency is:
implementation 'com.google.android.material:material:1.1.0'
Recyclerview dependency is:
implementation 'androidx.recyclerview:recyclerview:1.2.0'
So, you have to search and read carefully.
The docs has it wrong.
It should actually be 'com.android.support:design:22.2.0'
as mentioned in their official blog.
With gradle 3 it should be:
dependencies {
implementation 'com.android.support:design:27.0.2'
}
You can use:
compile 'com.android.support:design:22.2.0'
I built a complete example. I hope it helps! https://github.com/erikcaffrey/AndroidDesignSupportLibrary
Remember now is available!
Android Support Library, revision 22.2.1 (July 2015)
ctrl+alt+shift+s in the androidstudio window...
project structure window will appear..
click the app in the menu bar at the left then click dependencies..
then add `com.android.support:design:26.1.0
implementation 'com.android.support:design:28.0.0'
Click on 'File' --> 'Project Structure' (or CTRL+ALT+SHIFT+S) --> Select 'Dependencies' --> Click on '+' in the 'All Dependencies' section --> Select '1.Library Dependency'--> here you can search for any library to implement in your android studio project.
i was facing the same problem actually this is old one.
Just replace it with the following code:
implementation 'com.google.android.material:material:1.1.0'