[Q] Android Studio error when importing libs - Android Studio

I am trying to import some libraries, in Android Studio. I had the following error message: Error:The SDK Build Tools revision (17.0.0) is too low for project ':actionbarsherlock'. Minimum required is 19.1.0
So i installed Android SDK Build tools rev 19.1.0. I modified build.gradle file (app) looking like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
applicationId "com.example.xx.xx"
minSdkVersion 16
targetSdkVersion 19
versionCode 1
versionName "1.2"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.android.support:support-v4:19.1.0'
compile project(':actionbarsherlock')
compile project(':actionbarsherlock-fest')
compile project(':actionbarsherlock-i18n')
}
Also in Run/Debug Configurations, under App Engine DevAppServer, i set in App Engine SDK field the path for the new SDK, looks like that: C:\Users\cami\AppData\Local\Android\sdk\build-tools\19.1.0
So when i am trying to rebuild, i get exactly the same error message as before. Additionally, i had installed Android SDK Build tools rev 22.0.1, and i get warning saying update targetSdkVersion to 22.
Could please someone help me with this?
PS: Sorry for the very long post, and maybe for the many unnecessary details, but i am new in Android Dev.
Thank you

cinsa said:
I am trying to import some libraries, in Android Studio. I had the following error message: Error:The SDK Build Tools revision (17.0.0) is too low for project ':actionbarsherlock'. Minimum required is 19.1.0
So i installed Android SDK Build tools rev 19.1.0. I modified build.gradle file (app) looking like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
applicationId "com.example.xx.xx"
minSdkVersion 16
targetSdkVersion 19
versionCode 1
versionName "1.2"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.android.support:support-v4:19.1.0'
compile project(':actionbarsherlock')
compile project(':actionbarsherlock-fest')
compile project(':actionbarsherlock-i18n')
}
Also in Run/Debug Configurations, under App Engine DevAppServer, i set in App Engine SDK field the path for the new SDK, looks like that: C:\Users\cami\AppData\Local\Android\sdk\build-tools\19.1.0
So when i am trying to rebuild, i get exactly the same error message as before. Additionally, i had installed Android SDK Build tools rev 22.0.1, and i get warning saying update targetSdkVersion to 22.
Could please someone help me with this?
PS: Sorry for the very long post, and maybe for the many unnecessary details, but i am new in Android Dev.
Thank you
Click to expand...
Click to collapse
Try change "buildToolsVersion '19.1.0'" to "buildToolsVersion '22.0.0'" Pay attention that you should have installed build tools 22 in your SDK Manager.
It should help.

Related

android studio problem

Hi, i have the next problem, when i open a project in android stuidio, appear the next message
Error:Could not create an instance of Tooling API implementation using the specified Gradle installation 'C:\Program Files\Android\Android Studio\gradle\gradle-2.8'.
what could be? and What i can do?
Thanks for all
Have you tried updating Android Studio?
Also you could show build.gradle file for this project.
klisiecki said:
Have you tried updating Android Studio?
Also you could show build.gradle file for this project.
Click to expand...
Click to collapse
this show the file build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Hi!
Try to use last version of android studio gradle plugin.
Just change line
Code:
classpath 'com.android.tools.build:gradle:1.5.0'
to
Code:
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'

Getting java.util.zip.ZipException: duplicate entry for SimpleJavaMail

While building apk for my project, I'm getting the following error:
Code:
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/simplejavamail/email/AttachmentResource.class
Here's my gradle file:
Code:
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 24
buildToolsVersion '24.0.1'
defaultConfig {
applicationId "com.parassidhu.cdlumaths"
minSdkVersion 16
targetSdkVersion 24
versionCode 2
versionName "1.1"
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "8g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton:butterknife:8.0.1'
compile 'com.github.paolorotolo:appintro:3.4.0'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.hotchemi:android-rate:1.0.1'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'org.simplejavamail:simple-java-mail:4.1.1'
compile files('libs/simple-java-mail-4.1.1.jar')
}
apply plugin: 'com.google.gms.google-services'
I
I have no idea what's wrong. I can test the app fine but when I Rebuild project/build apk/generate signed apk, I get this error. Sometimes the duplicate entry points to different class than AttachmentResource.class.

Unable to resolve all dependencies in android studio 3.0

I am getting these errors while syncing gradle:-
Error:Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Error:Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.android.support:design:26.1.0.
Error:Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.android.support.test:runner:1.0.1.
Error:Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve junit:junit:4.12.
Error:Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.android.support.test.espresso:espresso-core:3.0.1.
METHODS TRIED
i have tried adding GOOGLE MAVEN REPO, mavencentral all with url & without url.
i have tried deleting .gradle folder from C:\Users\<username>/.gradle.
i have tried gradle offline work and online work, both end up with same error message.
tried clean project & rebuilding.
tried INVALIDATE CACHE & RESTART.
tried degrading the android studio version.
I AM USING WINDOWS 64BIT WITH 4GB OF RAM AND DUAL CORE 2.0 GHZ PROCESSOR, AND ANDROID VERSION 3.0, GRADLE VERSION 4.1 & 4.3(LATEST), I HAVE INSATLLED ALL THE NECESSARY TOOLS & EVERYTHING UPDATED IN SDK MANAGER. ANDROID SUPPORT REPOSITORY & GOOGLE OFFLINE REPOSITORY BOTH INSTALLED.
WHENEVER I TRY TO SYNC IT WITH OFFLINE WORK IT END UP WITH ERROR (NO CACHED VERSION OF THIS (DEPENDENCY IS FOUND), AND WHENEVER I TRY TO SYNC WITH ONLINE WORK, THE ERRORS ARE SAME LISTED ABOVE IN BOTH CASES.
I HAVE TRIED EVERYTHING FROM STACK OVER FLOW & YOUTUBE.
BUILD.GRADLE PROJECT:MY APPLICATION.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
BUILD.GRADLE MODULE:APP
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.vipinsaini.myapplication"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
CAN ANYONE PLZ HELP ME SOLVE THIS ISSUE. I am new to android studio plz omit mistakes.
Add google() to allprojects node in your root build.gradle file
allprojects {
repositories {
jcenter()
google()
}
}
Hey,
I have a same problem. I tried to do your solution, but already exist this code in build.gradle file.
I will be happy to another solution.
Thanks.
Try to Invalidate Cache/Restart that got the problem fixed for me
Unable to Resolve Dependencies
After much research and headache... Go to File\Settings\Gradle. Deselect the "Offline work" box. Now you can connect and download any necessary or missing dependencies.
Worked, thank you.
i tried invalidate and restart then delete .gradle file then uncheck the offline work but no use not clear the appcompact error

SDK version for app

Hi, i'm new to the forum, just registered. Im Argentinian so maybe my grammar is not perfect, but ill try to make me understandable.
Here is the thing, a year ago I was making an app on Android studio and my friend and I stopped for multiple reasons. Now, we have some time to finish it, but there is a problem with the gradle of the project and I remember that I solved it on that time. The thing is the versions of the api I used and the SDK versions.
First of all, app must be supported for a long range of devices, and we dont need much new things. So, we aim to get the most popular SDK as possible (However, we really need to use the APIs I will list below).
We were using SDK 26 and the project was build correctly on that date.
Now, Android studio Recommended to update to SDK 28 and I tried to do it, but still failed
I will list the API and SDK that I have at the moment: (remember to recommend the popular version of SDK and APIs versions of that SDK)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.1.0"
defaultConfig {
applicationId "com.example.xxxxxxxx.xxx"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:28.0.0'
compile 'com.android.support.constraint:constraint-layout:1.1.3'
compile 'com.android.support:support-v4:28.0.0'
compile 'com.android.support:design:28.1.0'
compile 'com.google.gms:google-services:3.2.0'
compile 'com.google.android.gmslay-services-auth:16.0.1'
testCompile 'junit:junit:4.12'
}
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'maven'
Sorry if its a newbie question or if I failed the place of the thread, but it would be really helpful if someone help me.
My regards,
Xrless.

AAPT2 process unexpectedly exit. Error output"

Hi everyone
I was trying to build my app on android studio but suddunly ive got this erreo: AAPT2 process unexpectedly exit. Error output"
and after that i cant build my app.so i search about it and did every soultion on Internet but non of them work for me.
im trying to fix this issue for 2 days.so please help me to fix it
thanks.
THIS IS MY GRADLE FILE:
Code:
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.weather5"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.android.support:support-annotations:28.0.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
delete you gradle file in studio dir then restart you studio

Categories

Resources