add android-support-v13.jar in Android Studio - android

I have been trying to add android-support-v13 in Android Studio 1.0.2
I have followed the steps here but I still get a build fail. Has anyone successfully managed to add android-support-v13.jar into Android Studio 1.0.2?
Below is my code in my gradle file.
dependencies {
compile 'com.android.support:appcompat-v7:21.0.3'
compile fileTree(dir: 'libs',include: '*.jar')
Edit: I have installed extra support library from SDK manager and I have placed the .jar in my libs folder.

according to docs at this time:
The Gradle build script dependency identifier for this library is as
follows:
com.android.support:support-v13:18.0.0
lets hope that the docs are updated.
for the latest you should use:
compile 'com.android.support:support-v13:21.0.+'

same problem android studio 1.0.2 i solve that below
compile 'com.android.support:appcompat-v7:21.0.1'
compile 'com.android.support:appcompat-v7:+'

Related

Adding Google Play Services to gradle (Android Studio) does not work

I have the following problem:
I installed the Google Play Services library v27.0.0 to my SDK in Android Studio.
After that I added the compile dependencie to build.gradle (app folder):
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.google.android.gms:play-services:27.0.0'
}
But when I try to sync the project with Gradle, i get this error message:
Error:(25, 13) Failed to resolve: com.google.android.gms:play-services:27.0.0
I don't know what to do...
I don't think version 27.0.0 exists the most recent version is 8.1.0
There is one trick you can use with any dependency.
You know the name of dependency, lets consider com.google.android.gms:play-services:
Firstly, you need to use this expression
compile 'com.google.android.gms:play-services:+'
Note the plus sign. Than you click Sync Now to sync gradle. After that you will see that IDE suggests you not to use + sign.
But now you can use combination Alt+Enter and select Replace with specific version.
Now + sign will be replaced with the latest available version of this library.
Profit.

Android studio 1.2.2 gradle library

Adding a gradle project with compile has been working for me very well, but I noticed after updating the Android studio to 1.2.2, or maybe the version just before it, that adding a library is not working anymore.
So for example I tried to add this and I did the "Sync Now" and it was successful but the library doesn't seem to be recognized. When I try to use ProgressWheel in Java and I hit ctrl+Enter it doesn't find the library, anyone have an idea of what should I do?
dependencies {
compile 'com.android.support:support-v4:21.0.0'
compile 'com.google.android.gms:play-services:+'
compile files('libs/universal-image-loader-1.9.3.jar')
compile 'com.romainpiel.shimmer:library:1.4.0#aar'
//the above libraries were added before the update, everything was
//working fine, the below isn't
compile 'com.pnikosis:materialish-progress:1.5'
}
Please note that I tried many other libraries and all had the same result.
The project README (front page of https://github.com/pnikosis/materialish-progress) says it's on Maven Central. Android Studio uses jCenter (by Bintray) by default. Add this in your module's build.gradle file:
repositories {
mavenCentral()
}

how do I properly install support-v7 repo in Android Studio

Currently my dependencies look like:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/volley_1_0_8.jar')
compile 'com.android.support:support-v4:21.0.2'
compile 'com.android.support:support-v7:21.0.2'
compile files('libs/volley.jar')
compile files('libs/picasso-2.4.0.jar')
}
Which gives me the following error:
Error:Failed to find: com.android.support:support-v4:21.0.2
Install Repository and sync project
Open File
Open in Project Structure dialog
It looks like I have everything needed inside the SDK:
Clicking on "Install Repository and sync project" prompts me to install the support repo rev 9 (which I already have, according to the SDK manager?)
While installing I always get the error
Failed to rename directory C:\Program Files (x86)\Android\android-studio\sdk\extras\android\m2repository to C:\Program Files (x86)\Android\android-studio\sdk\temp\ExtraPackage.old01.
It seems the directory is in use by Android Studio itself.
The question: how can I install the v7 support?
The current version of the support-v4 is 21.0.0. There is no such library as support-v7 - if you mean appcompat-v7, then that is also 21.0.0 as per gradleplease.appspot.com, which is a handy reference for the latest versions of various libraries.
The reason the SDK Manager has the version at 21.0.2 is because other parts of the support library (specifically, the Multidex support library) was changed since the initial release of version 21.0.0, but that did not change the support-v4 or other parts.

How to find the version of library from Gradle Dependency? Android Studio

Question:
How do I find the version of libraries that are being used when my Gradle file mentions a dependency using the '+' operator in the version number of the dependency?
Context
My build.gradle under app module reads like so:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:5.+'
}
What is the version of the play-services library that is being used here?
You can use gradles' build-in 'dependencyInsight' task to query the resolved version of your dependency:
gradle dependencyInsight --configuration compile --dependency com.google.android.gms:play-services
If you want to get an overview for all your dependencies in one go, you can do
gradle dependencies
If you use the gradle wrapper you must use ./gradlew instead of gradle
Look under .idea folder of your project
In the Project Pane on the left, browse to .idea/libraries
All the library dependencies that your project has have been mentioned, with each one getting its own xml file. You can see the version number included in the xml file title. The xml itself has the library file path.
(OR) Use Gradle's built in task to get dependencies
See steps here: https://stackoverflow.com/a/25236208/1311745
Android Gradle Dependency library version
Android Studio 3.1.4
You are able to use Project view
In Android Studio, in the build.graddle app, select the version and press ALT + ENTER, then select "Replace with specifyc version"

Import scribe-1.2.1.jar in Android Studio

What are the steps to import scribe-1.2.1.jar in android studio?
I have added the jar in the lib folder and have also added it using the add library option. But when I compile I am facing compile time error.
Gradle: package org.scribe.builder does not exist
Edit your module's build.gradle file, just append one line in the dependencies scope.
dependencies {
...
compile files('libs/android-support-v4.jar')
compile files('libs/scribe-1.2.1.jar')
}
FYI: at this time Android Studio project setting did not affect the gradle build, so you must edit it yourself.
there are a user guide for gradle android plugin.

Categories

Resources