I am working on a simple app with an activity and i use fragments.One screen with some elements. When i compile and run the app it works fine, except on Samsung Galaxy s3 an
I faced the same issue, that was caused by using attributes
as a reference to color
in an XML drawable.
As mentioned here on API < 21 you can't use attrs to color
in the XML drawable. So only way is to use a reference to a color resource (@color/YOURS_COLOR
) or use #RGB
format.
So if you want to use an XML drawable with theme depended colors you should create a drawable for each theme.
Change "AppTheme" to not use Material. For example try:
<style name="AppTheme" parent="android:Theme.Holo">
</style>
I had a very similar issue on my Samsung Galaxy Tab Pro 8.4 Running Android 4.2. It worked when I changed Styles.xml to use "android:Theme.Holo" or "Theme.AppCompat.Light.DarkActionBar".
I haven't been able to find any information on exactly why this happens, and why it seems to only affect Samsung products. If you really want to include Material as a style, you could try adding another style file to use with devices that have API level 21 or higher. More info on that is here under the section "Select a theme based on platform version"
Please keep us updated if you find any other fixes.
I had the same problem on API 10 devices and it was caused by using theme for API 11+ (from appcompat). For quick solution you may find the following themes declaration in styles.xml
<style name="AppBaseTheme" parent="...">
...
<style name="AppTheme" parent="...">
And change on:
<style name="AppBaseTheme" parent="android:Theme.Light">
...
<style name="AppTheme" parent="android:Theme.Light">
I ran into this when using 3rd party lib https://github.com/hoang8f/android-flat-button after I upgraded gradle to 3.0.1.
Not ideal, but downgrading gradle seemed to resolve the error
This change requires updating 2 files:
Project build.gradle with
com.android.tools.build:gradle:2.3.3
gradle/wrapper/gradle-wrapper.properties with
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip