dependency "androidx.core:core-ui" not found - android

When adding constraint layout group to my project, Android studio auto add the dependency in gradle:
implementation 'androidx.core:core-ui:+'
But I've got this error message:
Failed to resolve: androidx.core:core-ui:+
I couldn't find any way to add corresponding androidx dependency, the only solution I know so far is using support lib but It against the guideline to move everything to androidx.
com.android.support:support-core-ui:28.0.0
Is there any androix dependency which includes the ConstraintLayout Group?

Use this in your app gradle file instead...
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0-alpha1'

Try adding this to your build.gradle file implementation 'androidx.constraintlayout:constraintlayout:1.1.0'
constraint layout does not show up for me to drag it into the layout editor(3.2 canary) but I can use it by writing the code in xml and adding this library. For any other dependencies, try writing the specific dependency in gradle, it appears core-ui for androidx not working yet.
Edit:
There should be a download icon next to the dependencies you don't have. You can click on it and there will be a pop up stating the dependency name. In Studio 3.2 Canary on windows, it is not adding these dependencies automatically, which is why my solution is to implement the dependency in build.gradle manually.

Related

adding com.android.support:design:28.0.0 dependency

I am trying to add Floating Edit text to my app. For this have added 'com.android.support:design:28.0.0' dependency to my build.gradle (;app).
I'm getting this following error if try to run the project.
if need to refactor>Migrate to androidX :(please guide me to the process)
You don't need this dependency since you are using the Material components library (it is a drop-in replacement for Android's Design Support Library).
Just remove it.

cannot resolve symbol while importing constraintlayout in android studio 3.4.2

I am beginner in android and creating a program, whole thing is done but when importing constraintlayout with the importing statement 'import android.support.constraint.ConstraintLayout' code editor highlighed red and shows 'cannot resolve symbol'.
You can try using androidx or use thee version 28.0.0-alpha1 of support library
Refactor and migrate your code to Android X.
Then add this in your build.gradle file app level.
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
Sync changes to the project.
It's a bit hard to guess what the problem is without a code snippet or screenshot of how you're using constraint layout in your XML but I imagine this Gradle issue is caused you have not imported constraint layout to your build.gradle file. Make sure this is in your build.gradle file in the dependencies section:
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
The importing statment is as ...
import android.support.constraint.ConstraintLayout;

implementing card view in build.gradle

I am trying to implement card view by implementing it in my build.gradle.
However while doing this, I am getting an error. It is saying
"Version 28 (intended for Android Pie and below) is the last version of the legacy support library, so we recommend that you migrate to AndroidX libraries when using Android Q and moving forward. The IDE can help with this: Refactor > Migrate to AndroidX... less... (Ctrl+F1)"
I understand how to do it but am not sure if I should since I am not getting any build errors and my gradle is still syncing. Can someone tell me whats going on?
You are using androidx libraries together with a very old version of support library of cardview.
Remove the dependency of support library
//implementation 'com.android.support:cardview-v7:16.0.4'
and add:
implementation 'androidx.cardview:cardview:1.0.0'
More info about androidx here.
You have another option.
Just add the MaterialCard included in the official Material Components library:
implementation 'com.google.android.material:material:1.1.0-alpha10'
and in your xml you can use:
<com.google.android.material.card.MaterialCardView
...>
Just open your project and make the compile and target version to 28 , then sync then go to refractor on toolbar of studio , there you will see migrate to android x just tap on that. It will resolved all your issue.

material support library, can't find Cardview/Recycleview

I have searched the internet but i couldn't find my answer. How can I use Card view/Recycle view they are not in my layout palette or i can't use them manually and I am using eclipse
The CardView and RecycleView are not by default in the AppCompat library. You should include the CardView and RecycleView libraries manual to your project.
Reference: https://developer.android.com/training/material/lists-cards.html#Dependencies
Gradle (using Android Studio):
dependencies {
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
}
In the layout palette there is a section called "Custom" click on the "CustomView" and you shall see all the imported views from the dependencies added in the gradle file.
my problem when adding the library was the same as this guys problem
Unable to add library to android project
so I fixed it.

Including android.support.v7.app dependency in Android Studio

I'm migrating from Eclipse over to Android Studio and am looking at the Navigation Drawer example from Google. Right away, I see that I get this warning;
It looks like I need to use the v7 library rather than the v4. I can't figure out how to do this. In Eclipse, I just added a dependency from the build tools, but I see no such option in Android Studio. If I look at the build.gradle file, I can see this:
dependencies {
compile 'com.android.support:support-v4:21.0.3'
}
I just downloaded Android Studio yesterday, so I think that I should have this dependency somewhere, but I just don't know how to include it. Can someone tell me how to do this?
From within Android Studio, you can go to File, Project Structure, select your module, and go to the Dependencies tab - you'll see a list of dependencies - you can add new dependencies via the + sign near the bottom of that screen - it will automatically suggest the most popular libraries and all Google libraries including the one you want: appcompat-v7. This controls the build.gradle file and, in your case, adds the line:
compile 'com.android.support:appcompat-v7:21.0.3'
Note that you can also use sites such as Gradle, please to manually figure out what the dependency should be and add it to your build.gradle file yourself if you'd like.

Categories

Resources