skip to Main Content

My Android project has error while producing signed APK as below.

File 'root/res/drawable-mdpi/popup_bottom_medium.9.png' uses reserved file or directory name 'res'.ere

It didn’t appear when I make APK without sining.

I found popup_bottom_medium is in android sdk (android-28) but I dont know why the error is happening on this specific file.

enter image description here

Please kindly help us

let me put build.gradle in our code. Actually in this project, we using two self-made library. so totally we have three build.gradle.

  1. build.gradle for app itself
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "xxx.xxx.xxx"
        minSdkVersion 24
        targetSdkVersion 28
        versionCode 1
        versionName "0.0.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation project(path: ':mylibrary')

    implementation 'com.google.code.gson:gson:2.8.5'

    implementation 'com.parse.bolts:bolts-tasks:1.4.0'
    implementation 'com.parse.bolts:bolts-applinks:1.4.0'
    implementation project(path: ':ERSDKLogin')
    implementation 'com.github.bumptech.glide:glide:4.4.0'
    //noinspection GradleCompatible
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation 'com.android.support:design:28.0.0'

    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'

    // Measures against compile errors that occur when adding「'com.google.android.gms:play-services-maps:16.0.0' 」
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:support-media-compat:28.0.0'
    implementation 'com.android.support:animated-vector-drawable:28.0.0'
    implementation 'com.android.support:customtabs:28.0.0'

    //graphLibrary
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}
  1. build.gradle for library one
    apply plugin: 'com.android.library'

    android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'



    defaultConfig {
        minSdkVersion 23
        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'
        }
    }

    // TODO Remove and fix lint issues
    lintOptions {
        abortOnError false
    }

    }

    dependencies {
        api project(':aws-android-sdk-core')
        api project(':aws-android-sdk-cognitoidentityprovider')
        api project(':facebook-common')
        api project(':facebook-core')
        api project(':facebook-login')
        api 'com.google.android.gms:play-services-auth:16.0.1'
        api 'com.squareup.retrofit2:retrofit:2.4.0'
        api 'com.squareup.retrofit2:converter-jackson:2.4.0'
        api 'com.fasterxml.jackson.core:jackson-databind:2.9.5'
        api 'com.squareup.okhttp3:logging-interceptor:3.10.0'
        compileOnly 'org.projectlombok:lombok:1.16.22'
        annotationProcessor 'org.projectlombok:lombok:1.16.22'
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation "com.android.support:appcompat-v7:${project.ext.supportLibraryVersion}"
        implementation 'com.android.support.constraint:constraint-layout:1.1.3'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    }
    repositories {
        flatDir{
            dirs 'libs'
        }
    }
  1. build.gradle for library two
apply plugin: 'com.android.library'

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 24
        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'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}

dependencies {
    implementation project(':ERSDKLogin')

    compileOnly fileTree(dir: 'libs', include: ['*.jar'])

    testImplementation 'junit:junit:4.12'
    //noinspection GradleCompatible
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'no.nordicsemi.android.support.v18:scanner:1.0.0'
    implementation 'no.nordicsemi.android:dfu:1.6.1'

    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.parse.bolts:bolts-tasks:1.4.0'
    implementation 'com.parse.bolts:bolts-applinks:1.4.0'
    implementation 'com.google.android.gms:play-services-fitness:15.0.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
}

2

Answers


  1. I put my 9-patch files in the drawable folder, not the drawable-mdpi etc… folders. Try that and see if it helps.

    Login or Signup to reply.
  2. file name change. eg popup_bottom_medium_9.png

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search