Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android build error for values-b+sr+Latn

Hi i am trying to build my first project using Android support libraries in order to support material design for all of the devices on market. At the very begining of my journey i create a project from scratch and when i build from graddle using this module configuration:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "19.1"
    defaultConfig {
        applicationId "com.sunshine.org.weather"
        minSdkVersion 13
        targetSdkVersion 24
        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(include: ['*.jar'], dir: 'libs')
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
    testCompile 'junit:junit:4.12'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:support-v13:24.2.1'
}


i get theese errors -->>>


GRADDLE ERROR:
:app:generateDebugResources UP-TO-DATE :app:mergeDebugResources :app:processDebugManifest UP-TO-DATE :app:processDebugResources invalid resource directory name: C:\Users\weather\app\build\intermediates\res\merged\debug/values-b+sr+Latn

FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:processDebugResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
When i deleted the "values-b+sr+Latn" folder containing the coresponding XML file, it always gets recreated by the studio when i build my project. I Tried to clean and build but that did not serve as solution to my problems.


I am trying to run the app on KitKat(API Level 14) and want to have material design down to HONEYCOMB(API Level 13) and support application up to NOUGAT(API Level 24) Could you please point out my mistakes?

like image 754
Tim Avatar asked Dec 11 '22 14:12

Tim


2 Answers

Try this in build.gradle

aaptOptions {
    ignoreAssetsPattern "!values-b+sr+Latn"
}
like image 119
powder366 Avatar answered Dec 31 '22 14:12

powder366


To expand on powder366's answer, and the comment, since I don't have the rep to comment myself.

Inside the Gradle Script called 'build.gradle' for the Project:Name, there is an 'android' section with brackets. Inside those brackets you can add

aaptOptions { ignoreAssetsPattern "!values-b+sr+Latn" }

So you'd end up with something like

android {
   aaptOptions {
       ignoreAssetsPattern "!values-b+sr+Latn"
   }


}

That fixed it for me right away, when Rebuilding the project

like image 44
SeanMC Avatar answered Dec 31 '22 14:12

SeanMC