No Resource found error during compilation| Android - android

This question is being posted after quite some extensive research and failing at finding the solution. When i try to compile my project i get this error:
Error:(94, 54) No resource found that matches the given name (at 'android:actionModeCloseDrawable' with value '#drawable/abc_ic_ab_back_mtrl_am_alpha').
Below is my build.gradle:
apply plugin: 'com.android.application'
ext {
supportLibVersion = '25.3.1'
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.editor.photoeditor"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:support-annotations:${supportLibVersion}"
compile "com.android.support:support-v4:${supportLibVersion}"
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile('com.afollestad.material-dialogs:core:0.8.1.0#aar') {
transitive = true
}
compile 'com.github.javiersantos:MaterialStyledDialogs:1.4.1'
compile 'com.github.darsh2:MultipleImageSelect:v0.0.4'
compile 'com.github.lopei:collageview:0.1.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.orhanobut:logger:1.11'
compile 'com.adobe.creativesdk.foundation:auth:0.3.94'
compile 'com.adobe.creativesdk:image:4.0.0'
compile 'com.github.QuadFlask:colorpicker:0.0.8'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.cocosw:bottomsheet:1.+#aar'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
What i have tried up till now:
1) Clean Project and Rebuild Project
2) Deleted build folder and rebuilt project
3) upgraded, downgraded to all possible versions between 23.0.0 and final version of support library given in my build.gradle.
4) Gone through almost every article and most of them propose to change the name of variable #drawable/abc_ic_ab_back_mtrl_am_alpha to R.drawable.abc_ic_ab_back_materia but since it is in <style name="MD_Dark" parent="Theme.AppCompat.Dialog.Alert"> style and problem only shows during compilation, hence, i can not change the name of this item as well.

Following bug was resolved by updating support library version to 25.3.1. After updating the support library version rebuild the whole project and don't just sync the gradle afterwards. Only syncing build.gradle my cause the problem to come up again, so rebuild the whole project every time you have sync the gradle.

Related

Error: Configuration with name 'default' not found in Android Studio, Volley and ArcMenu

I have an old volley configuration in my app. The app was built to target lollipop devices few years ago. I have also used an arcmenu library in same configuration like compile project('volley') and compile project('arcmenu').
Recently, I have reopened that project and tried running it again but it gives me this error:
Error: Configuration with name 'default' not found in Android Studio
I have installed all the previous platforms, from 21 to 26 in my sdk. Here's my gradle file
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "in.co.memoize"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-gcm:7.5.0'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'org.apache.httpcomponents:httpcore:4.3.2'
compile 'org.apache.httpcomponents:httpmime:4.3.2'
compile 'com.getbase:floatingactionbutton:1.5.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.hdodenhof:circleimageview:1.2.2'
compile 'com.github.markushi:circlebutton:1.1'
compile 'it.neokree:MaterialTabs:0.11'
compile 'com.jpardogo.materialtabstrip:library:1.0.9'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'com.navercorp.pulltorefresh:library:3.2.0#aar'
compile 'com.github.orangegangsters:swipy:1.2.0#aar'
compile 'com.android.volley:volley:1.1.0'
//compile project(':volley')
compile project(':arcmenu')
}
After installing the platform versions, I get this message:
Error:Unsupported method: BaseConfig.getApplicationIdSuffix().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
My settings.gradle file:
//include ':app', ':volley' commented to triangulate which library was
causing the problem but still not fixed
include ':app'
include ':arcmenu'
and arc menu gradle file:
apply plugin: 'com.android.library'
android {
compileSdkVersion 19
buildToolsVersion "21.1.0"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
Can anyone help me in resolving this issue? Thanks
I have fixed this by downloading and adding the dependencies as .aar/.jar files

Execution failed for task ':app:transformClassesWithMultidexlistForDebug' in Android Studio 2.3

I can build my project but can not run the app. When executing app it gives me error like
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.multidex.ClassReferenceListBuilder with arguments {/home/Git_Projects/Test1/app/build/intermediates/multi-dex/debug/componentClasses.jar /home/Git_Projects/Test1/app/build/intermediates/transforms/jarMerging/debug/jars/1/1f/combined.jar}
I tried to clean and rebuild project and Invalidate Catche and Restart. But, nothing helped me.
build.gradle (app)
apply plugin: 'com.android.application'
android {
dexOptions {
javaMaxHeapSize "4g"
}
compileSdkVersion 26
buildToolsVersion "26.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.app.test1"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
maven { url 'https://github.com/Kaustubh-Deshmukh/progressbar_repo/raw/master' }
maven { url 'https://dl.bintray.com/yazeed44/maven' }
}
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:multidex:1.0.1'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.google.android.gms:play-services-places:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-vision:10.0.1'
compile 'com.github.clans:fab:1.6.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.googlecode.libphonenumber:libphonenumber:7.1.1'
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.android.support:design:26.0.0'
compile 'com.android.support:recyclerview-v7:26.0.0'
compile 'com.android.support:cardview-v7:26.0.0'
compile 'com.android.support:support-v4:26.0.0'
compile 'com.android.support:support-annotations:26.0.0'
compile 'com.android.support:percent:26.0.0'
compile 'com.android.support:support-v13:26.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.facebook.fresco:fresco:1.5.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.kontaktio:sdk:3.3.2'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
testCompile 'junit:junit:4.12'
}
If I randomly remove some dependencies, then it executes fine. Does large app size creating problem to execute app ?
I am using android studio 2.3 and java-8-openjdk-amd64 and ubuntu 16.04
One strange thing : Everything was working correct before executing command
apt-get update
I am searching from days but nothing seems work.
As from your build.gradle file you have two versions for
compile 'com.android.support:support
Try using only one of the following:
compile 'com.android.support:support-v4:26.0.0'
compile 'com.android.support:support-v13:26.0.0'
Try to add below to build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
Try to build by command line
gradle clean assembleDebug
After updating Android Studio from 2.3.0 to 3.0.1 , my problem solved.
Now, it works perfect.

Android - Request to update to com.google.android.gms to 9.0.0

I just got back from lunch. I didn't make any changes; gradle sync ran on its own and now I have this message.
Did anyone encounter that? I had that tomorrow, built again and everything ran smoothly. I'm stuck.
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.
Here my Gradle file, but really I don't get it T_T
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId '*****'
minSdkVersion 19
targetSdkVersion 23
versionCode 999999
versionName "3.0.4"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
apply plugin: 'com.google.gms.google-services'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.code.gson:gson:2.4'
compile 'com.google.android.gms:play-services:9.6.1'
compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.firebase:firebase-messaging:9.6.1'
compile 'com.google.maps:google-maps-services:0.1.3'
compile 'io.card:android-sdk:5.4.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.orhanobut:dialogplus:1.11#aar'
compile 'com.android.support:support-v4:23.4.0'
}
apply plugin: 'com.google.gms.google-services'
Upadate your Google Play Services from sdk tools.

Android studio(2.1.1 April 28-2016) Strange Error converting bytecode to dex. Dex cannot parse version 52 byte code

I'm trying to build my project and get this strange error (cause all worked perfectly in previous AS versions)
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
I understand that the problem is that (as the error tells me) some of my dependencies was compiled with java ver.8 but how I know which one of them?
Here is my build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.android.app.mysuperapp"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
androidTest {
setRoot('src/test')
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
sourceCompatibility = 1.7
targetCompatibility = 1.7
//<!-- TestFrameWork
testCompile 'org.robolectric:robolectric:3.1-rc1'
androidTestCompile 'junit:junit:4.12'
//
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'me.dm7.barcodescanner:zxing:1.8.4'
//----Materal design libs
compile 'com.github.rey5137:material:1.2.2'
compile 'com.github.navasmdc:MaterialDesign:1.5#aar'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile('com.github.ganfra:material-spinner:1.1.0') {
exclude group: 'com.nineoldandroids', module: 'library'
exclude group: 'com.android.support', module: 'appcompat-v7'
}
//<--
compile 'se.emilsjolander:stickylistheaders:2.7.0'
compile('com.thoughtworks.xstream:xstream:1.4.8') {
exclude group: 'xmlpull', module: 'xmlpull'
}
//----LogBack&SLF4J
compile 'org.slf4j:slf4j-api:1.7.21'
compile 'com.github.tony19:logback-android-core:1.1.1-5'
compile('com.github.tony19:logback-android-classic:1.1.1-5') {
// workaround issue #73
exclude group: 'com.google.android', module: 'android'
}
compile 'com.jakewharton:butterknife:8.0.1'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
}
I've googled alredy similar questions on SO (like this one or this) but adding this lines to build gradle
dependencies {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
didn't solve my problem. I am pretty stuck and I need someone help. Thanks in advance.
Your problem is compile('com.thoughtworks.xstream:xstream:1.4.8') that depends on Java 8
Version 1.4.7 doesn't depend on Java8, so if you can live with 1.4.7 the fix is quite simple.

failed to find 'com.firebase:firebase-ui:0.2.0' in android studio

I want to use firebase UI in my android app, but it constantly give build error while adding dependency in `android studio
i tried the tutorial at https://github.com/firebase/FirebaseUI-Android#using-the-library-in-your-android-app and
https://www.firebase.com/blog/2015-08-27-firebaseui-makes-mobile-easy.html
But both gives me same error
here is my build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
applicationId "re.book.bookify"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
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:22.2.0'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.github.shell-software:fab:1.1.2'
compile 'com.github.shell-software:viewmover:1.1.0'
compile 'com.github.shell-software:uitools:1.1.0'
compile 'com.firebase:firebase-client-android:2.3.1+'
compile 'com.firebase:firebase-ui:0.2.0'
}
Please post your build.gradle First
Add the following lines to the dependencies object at the bottom:
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.firebaseui:firebase-ui:0.2.0'
Check This Instructions
https://github.com/firebase/FirebaseUI-Android#using-the-library-in-your-android-app
Thanks Frank van Puffelen, that was the exact problem.
The gradle link given at https://www.firebase.com/blog/2015-08-27-firebaseui-makes-mobile-easy.html is not correct,
The 0.2 version of FirebaseUI was published in the com.firebaseui group. So the gradle link for it is compile 'com.firebaseui:firebase-ui:0.2.0'

Categories

Resources