I have working project.
- minSdkVersion 17
- com.android.tools.build:gradle:2.3.3
- gradle 4.1
- Android Studio 3 Canary 6
I have in my gradle files:
defaultConfig {
vectorDrawables.useSupportLibrary = true
vectorDrawables.generatedDensities = []
}
I call in activity too:
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)
Application works perfectly. Now change to:
- com.android.tools.build:gradle:3.0.0-alpha6
- add to repositories
google()
line
Execute gradle clean assembleDebug
.
App continue works on devices with API > 20. But for API < 21 (google android emulator) get crash on start application.
I see in logcat error: Resources$NotFoundException: Resource ID #0x7f080058
(0x7f080058 is drawable abc_vector_test).
Why?
UPD 2017-07-19: It was fixed and released in com.android.tools.build:gradle:3.0.0-alpha7
I am facing the same problem, downgrade Android Studio to previous version canary5 and write the following in your build.gradle
I'm add to
gradle.properties
lineand it's solve my error.
UPD 2017-07-19: It was fixed and released in com.android.tools.build:gradle:3.0.0-alpha7
Gradle plugin from version 3 use new AAPT, that have some bugs.
After reading some issues on bug tracker, I've found that Gradle has option for full disable AAPT2:
android.enableAapt2=false
Also from release notes to alpha5: