Issue
When I run a wizard generated andorid app on Android 2.2 (Froyo) I get a runtime exception telling me that
resource
divider_horizontal_bright_opaque.9.png
is not foundandroid.view.InflateException: Binary XML file line #5: Error inflating class
Caused by: java.lang.reflect.InvocationTargetException
Caused by: android.content.res.Resources$NotFoundException:
File res/drawable-mdpi/divider_horizontal_bright_opaque.9.png from drawable resource ID #0x0
What I expected:
- the missing resource
divider_horizontal_bright_opaque.9.png
- is referenced by the non-usergenerated-code
- which should be included in the library/aar
com.android.support:support-v4:19.1.0
orcom.android.support:appcompat-v7:19.1.0
- which should be included into the app by the gradle build.
Does anybody know how to fix this?
How to reproduce:
Using android studio 0.5.9 wizard I created an Android Application with these settings
- minimum required sdk
api8: Android 2.2 (Froyo)
- target sdk:
api19: Android 4.4 (KitKat)
- compile with:
api19: Android 4.4 (KitKat)
- Theme :
Holo Light with Dark Action Bar
- selected checkboxes Create Activity [X], Fragments [X], ActionBar[X]
- Activity-Type:
Master/Detail Flow
This is the gradle build fils
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
packageName "com.example.tests.android.gui"
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.android.support:support-v4:19.1.0'
}
the build was made with
- gradle 1.10
Solution
After creating a minimum android.support.v4.app.ListFragment
app with no dependency to com.android.support:appcompat-v7
i still got the same android.content.res.Resources$NotFoundException. So the problem must be related to com.android.support:support-v4 -
FragmentSupport that references
- res/drawable-mdpi/divider_horizontal_bright_opaque.9.png and
- res/drawable-hdpi/divider_horizontal_bright_opaque.9.png
On my machine i found
under ".../platforms/android-7/data/res/drawable-mdpi/divider_horizontal_bright_opaque.9.png"
the missing file and added it to my app.
After that the v4.app.ListFragment
app is working
[Update]
the divider_horizontal_bright_opaque.9.png
must have become some global android resource, because a second android app that uses the same libs doesn-t crash any more after the first app with the missing files was installed.
Answered By - k3b
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.