4

I would like to build my application and send it over to my samsung tablet using android 4.2.2. But I would like to have my application compatible with newer versions too (i.e. API 23)

I start the application using this command :

react-native run-android

When it's building I receive this error, I clean the project twice already with no success. I do not use eclipse or android studio.

:app:processDebugResourcesinvalid resource directory name: D:\Projects\react-native\project\android\app\build\intermediates\res\merged\debug/drawable-anydpi-v21

This is a part of the gradle file.

android {
    compileSdkVersion 17
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.project"
        minSdkVersion 17
        targetSdkVersion 23
        ...
    }
    dependencies {
        compile fileTree(dir: "libs", include: ["*.jar"])
        compile "com.android.support:appcompat-v7:18.0.+"
        compile "com.facebook.react:react-native:+"  // From node_modules
    }

1 Answers1

3

Folders in the res-Folder are only allowed to be those defined by Android, for example "drawable".

read - https://developer.android.com/guide/topics/resources/available-resources.html

"Drawable Resources- Define various graphics with bitmaps or XML. Saved in res/drawable/ and accessed from the R.drawable class."

If you choose anything else you get the error "invalid resource directory name" when building your project.

and a note

compileSdkVersion -(is your way to tell Gradle what version of the Android SDK to compile your app with)always compile with the latest SDK ,changing your compileSdkVersion does not change runtime behavior.

minSdkVersion is the lower bound for your app. - one of the signals the Google Play Store uses to determine which of a user’s devices an app can be installed on.

targetSdkVersion -targetSdkVersion is the main way Android provides forward compatibility by not applying behavior changes unless the targetSdkVersion is updated.

Charuක
  • 12,229
  • 5
  • 43
  • 83
  • I do not touch/create/modify any of those folder, this is done by the build itself. My guess is that I have an error in my build configuration... – Maxime Roussin-Bélanger Sep 13 '16 at 02:03
  • did that work before ? are you sure that you didn't add / change a file under res folder? go and check manually is there any file exits under res folder with this unusual name – Charuක Sep 13 '16 at 02:08
  • The only thing that I changed are the build versions because I just receive a test tablet and it has to work on 4.2.2 and most recent. – Maxime Roussin-Bélanger Sep 13 '16 at 02:09
  • There is a folder with that name, when I delete it and start the build, it creates it again. so same error. – Maxime Roussin-Bélanger Sep 13 '16 at 02:12
  • 1
    well can you chnage your api levels like this (just change the min sdk clean build and see if the error occours) keep the compileSdkVersion buildToolsVersion as the way it was may be 23/ 24 http://stackoverflow.com/questions/19465049/changing-api-level-android-studio – Charuක Sep 13 '16 at 02:27
  • 1
    just added a small note for you! – Charuක Sep 13 '16 at 02:35