Android studio IDE choose dependency dialog - android

I am unable select any external library in my project other than com.google libs from the 'Choose Dependency libraries' dialog in the android studio 3.01.
I am not sure of any missing gradle settings and this issue exists even in any new Android studio project. Any help in resolving this is appreciated.

Just add this in your build.gradle file-:
implementation 'com.squareup.retrofit2:retrofit:2.3.0'

Simply add below code in build.gradle file.
dependencies {
compile 'com.squareup.retrofit2:retrofit:2.3.0'
}
And if you want add other third party library then visit it's doc section you find gradle dependecy for it.
Read more about add third library in Android Studio projects.
How to use/import library in Android Studio

Related

i cannot find my project build.gradle file to add dependency

I cannot find my build.gradle project file to add dependency only my android studio contains 1 module build.gradle but cannot find the other one to add dependency.
i need to add the google vision dependency in my project but i am not getting where to write the dependency code
like
compile 'com.google.android.gms:play-services-vision:11.0.4'
can please anyone help me out regarding this problem
You can create a new project and then copy it from there

Generate android gradle dependency using intelliJ idea plugin

I am try to write a IntelliJ plugin that will automatically add dependency to android build.gradle file.
dependencies {
compile com.XXX.XX }
For example when we add Crashlytics plugin in android studio.
its adds a dependency in build.gradle file. I need the exact solution for my plugin. I refer the below link
How to add gradle dependency automatically
Kindly give more idea to implement this.

How to import Material Design on Android Studio project

I want to use this Material Design :
https://github.com/navasmdc/MaterialDesignLibrary
I have Imported it into my project and changed version numbers in build.gradle of it to versions of build.gradle of my app
Now there is a build error :
Error:(24, 13) Failed to resolve: com.nineoldandroids:library:2.4.+
I have searched and founded some solutions such as change 2.4.+ to 2.4.0 ! or this link, but they didn`t solve the problem
The question is :
When a project imported, what should be same in imported build.gradle versions and my app build.gradle versions ?!
My project compile in offline mode, Should I disable offline mode and let the Android Studio to download gradle files needed ?
As the link for the library says, do the following in the build.gradle. Copy the compile statement below in the dependencies tag. Your library name was wrong.
repositories {
jcenter()
}
dependencies {
compile 'com.github.navasmdc:MaterialDesign:1.5#aar'
}
You will find the dependencies in the build.gradle in the app folder not in the project folder.
You need to disable offline mode. After the library is imported you can go back to offline mode.
About the cannot resolve error:
nineoldandroid library is very old and now deprecated. I believe the material design library is using NineoldAndroid library. For some reason, it not able download this library. Why don't you add the nineoldandroid library first. If the material design library finds it then it may not try to download it.

How to import github library in eclipse

I am trying to use material designing library https://github.com/drakeet/MaterialDialog from github in my eclipse but I didnt found any jar file in this library project. So how can I use this library in my project in eclipse
If you have a Gradle build, as mentioned in the README, you just add:
dependencies {
compile 'me.drakeet.materialdialog:library:1.2.2'
}
As explained in the blog post, this looks like (in Android Studio)
You have to convert this library project from gradle to eclipse. You can get many links over the web for it. Try this.
The library project you are looking is build into android studio(Gradle). So I recommend you to use android studio instead of eclipse.
I recommend you to use Android Studio with Gradle support by default. But if you want use Eclipse download Gradle plugin and add this lib as dependency
dependencies {
compile 'me.drakeet.materialdialog:library:1.2.2'
}

Add android-numberpicker backport to Android Studio Gradle project

I want to use this library in my Android Studio project https://github.com/SimonVT/android-numberpicker. I can't for the life of me figure out how to add it to my project. Can someone just outline how this would work? I've only ever added libraries that were contained in jar files.
In build.gradle, use:
dependencies {
compile group: 'net.simonvt', name: 'android-numberpicker-parent', version: '1.0.0'
}
If you are using new gradle build system (and you really should), just add
compile 'net.simonvt:android-numberpicker:1.0.0'
to your build.gradle's dependencies section.
I found a forked version of this library which can be imported from source as a module in Android Studio. It is available here:
https://github.com/heavyplayer/android-numberpicker

Categories

Resources