Android resource directory name is invalid, drawable-anydpi-v21
I want to build my application and send it to my Samsung tablet using Android 4.2.2. But I also want my application to be compatible with the newer version (i.e. API 23)
I start the application with the following command:
react-native run-android
During construction, I received this error. I have cleaned up the project twice, but failed. I don't 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 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
}
resolvent:
Folders in res folder can only be defined by Android, such as "drawable"
Read- https://developer.android.com/guide/topics/resources/available-resources.html
"Drawable resources - use bitmaps or XML to define various graphics. Save them in RES / drawable / and access them from the r.drawable class."
If you choose any other option, you will receive an error message "invalid resource directory name" when building the project
Compilesdkversion - (used to tell gradle which version of Android SDK to use to compile your application) always compile with the latest SDK. Changing compilesdkversion will not change the runtime behavior
Minsdkversion is the lower limit of your application. - one of the signals used by Google play store to determine which user device can install the application
Targetsdkversion - targetsdkversion is the main way for Android to provide forward compatibility by not applying behavior changes (unless targetsdkversion has been updated)