I am unable to compile 'compile .android...' any dependicies from my last update , After some update like Android support library, android support repository , sdk platform tools in SDK manager. I am unable to add dependency, whenever i add it shows below error
And If i change my dependency compiled like this to latest As
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
}
it shows like this :
So please solve my problem i m unable to work with android studio, say ur suggestions for above.
Please check if this folder exist
C:\Program Files\Android\Android Studio\gradle\m2repository\com\android\tools on your machine. If it does not, y advice is to remove Android studio and reinstall it. Note: The binary version and not the Archived version of AS
do u set compileSdkVersion 23 and buildToolsVersion "23.0.1"?
Update android SDK to latest version 23 and see that your gradle file content is similar to below
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "yur id"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
}
Related
I recently decided to learn Android programming, so I installed Android Studio and Android SDK on my Ubuntu machine. The issue is when I build a new project, it says :
Gradle Sync completed with some erros
and the log is :
/home/moein/apps/android-studio-projects/Testapp/app/build.gradle
Error:Error:line (24)Failed to resolve: com.android.support:appcompat-v7:23.+
Error:Error:line (23)Failed to resolve: junit:junit:4.12
my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.moein.testapp"
minSdkVersion 23
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
}
Do you have this in your build.gradle file:
compile 'com.android.support:appcompat-v7:23.3.0'
The most probable reason for such errors is you do not have all support libraries installed. Go to SDK manager and install all the supporting repositories. For more details you can visit this answer.
These are the correct version that you can add in your build.gradle according to the API needs.Use it by your requirement.
API 21:
compile 'com.android.support:appcompat-v7:21.0.1'
OR
compile 'com.android.support:appcompat-v7:21.0.2'
OR
compile 'com.android.support:appcompat-v7:21.0.3'
API 22:
compile 'com.android.support:appcompat-v7:22.0.0'
API 23:
compile 'com.android.support:appcompat-v7:23.2.0'
Try Installing the following Highlighted item:
I found the answer to this problem.
I used to get it whenever I open a new project.
Just paste these lines in build.gradle (module:app)
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
Sync it again it will probably solve your problem.
today I upgraded my studio, and every latest sdkBuild version.
now my build.gradle(app) configuration looks like this:
android {
compileSdkVersion 23
buildToolsVersion "24.0.0 rc1"
defaultConfig {
applicationId "com.mydesign.rockstar.androidndemo"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
}
now it says a newer version of com.android.support:appcompat-v7 than 23.2.0 is available: 24.0.0-alpha1 as well as for design: 23.2.0
its not working correctly, and my app crashing. toolbar error, style error, everything is not properly working. Please help me understand what the actual problem is?
its working fine now, bcz i m just downloaded android support repository rev.28 and change both appcombat and design library to latest version. now its
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
this is latest version till now
what i learn is always use stable version of dependency. and this is what you can find it here
I am following a guide on using the Recycler View, I having trouble with the part of declaring the dependency and installing the RecyclerView into Android Studio.
I added the RecyclerView to my xml file and declared the dependency in build.gradle(below)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.ryde.chris.ryde"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.android.supportrecyclerview-v7:23.0.0'
}
I rebuilt the app and tried installing the Recycler View repo. When installing, I ran into the same exact issue that this user did.
I took a look at the answer on that thread. I chose to use RecyclerView v 23.0.0 and made sure that I compiled with api version 23 (compileSdkVersion 23 in build.gradle). Using the AVD manager, I also made sure that my support library for api version 23 was installed and updated
Does anyone know why I am still getting this issue? Internet is working fine (this to be specific)
Change
compile 'com.android.supportrecyclerview-v7:23.0.0'
to
compile 'com.android.support:recyclerview-v7:23.0.0'
Use the new version:
compile 'com.android.support:recyclerview-v7:23.1.1'
I'm getting "Error: Android Source Generator:[app_name] Android SDK is not specifed" in Android Studio while trying to Build Project.
I have Android Studio 1.0.2 RC4 version.
What have been done:
SDK installed ith SDK Manager
Project Structure -> SDK; I have added there minimum and target SDK as well
updated build.gradle
build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.byoutline.pinafood"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'com.etsy.android.grid:library:1.0.5'
compile 'org.glassfish:javax.annotation:3.1.1'
compile 'com.squareup:otto:1.3.5'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'com.squareup.dagger:dagger:1.2.2'
provided 'com.squareup.dagger:dagger-compiler:1.2.1'
compile 'com.jakewharton.hugo:hugo-runtime:1.1.0'
compile 'com.jakewharton.timber:timber:2.4.+'
}
Go to Project Structure->SDK Location and make sure the path is set correctly.
Okay, so I had to upated build:gradle to 1.0.0 (only by changing those number in build.gradle file and change from runProguard to minifyEnabled.
I try to add this lib (https://github.com/daimajia/AndroidImageSlider) to my project. I added the compile library in my gradle file, but i get an error :
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion '20.0.0'
defaultConfig {
applicationId "com.pp.myapp"
minSdkVersion 16
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.2'
compile 'com.iangclifton.android:floatlabel:1.0'
compile 'com.google.android.gms:play-services:5.0.89'
compile "com.android.support:support-v4:+"
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.0.9#aar'
}
And i get this error :
Error:Module version com.android.support:support-v13:13.0.0 depends on libraries but is not a library itself
Try adding this dependency:
compile 'com.android.support:support-v13:19.0.+'
You have to install the Android Support Library from the SDK, too.
I got the same error with an oauth library. It was fixed after a while when, tired of implementing new changes to the build.gradle like changing the support libraries, I discarded the changes on the file (via Sourcetree). It synchronized and automatically got fixed.
(Android Studio) It's a kind of magic.