KISS icon indicating copy to clipboard operation
KISS copied to clipboard

Crash when using Rounded bars on Android KitKat

Open bboa opened this issue 8 years ago • 14 comments

  • app version 3.0.6 (f-droid build) and previous
  • android version KK 4.4.2
  • device used Xperia E1
  • custom settings that might have an impact - missed

If this functions can't be released for KK, I suggest to simply hide them from Settings to avoid such problems.

bboa avatar Mar 26 '18 00:03 bboa

Log?

licaon-kter avatar Mar 26 '18 05:03 licaon-kter

@licaon-kter, https://gist.github.com/bboa/bc6577ecdbc6dc344e37340cc560fa45

E/AndroidRuntime( 4728): FATAL EXCEPTION: main
E/AndroidRuntime( 4728): Process: fr.neamar.kiss, PID: 4728
E/AndroidRuntime( 4728): java.lang.RuntimeException: Unable to start activity ComponentInfo{fr.neamar.kiss/fr.neamar.kiss.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable/rounded_result_layout.xml from drawable resource ID #0x7f06000f
E/AndroidRuntime( 4728): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2279)
E/AndroidRuntime( 4728): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2329)
E/AndroidRuntime( 4728): 	at android.app.ActivityThread.access$800(ActivityThread.java:145)
E/AndroidRuntime( 4728): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
E/AndroidRuntime( 4728): 	at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 4728): 	at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 4728): 	at android.app.ActivityThread.main(ActivityThread.java:5214)
E/AndroidRuntime( 4728): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4728): 	at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 4728): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:814)
E/AndroidRuntime( 4728): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:630)
E/AndroidRuntime( 4728): 	at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 4728): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/rounded_result_layout.xml from drawable resource ID #0x7f06000f
E/AndroidRuntime( 4728): 	at android.content.res.Resources.loadDrawable(Resources.java:2121)
E/AndroidRuntime( 4728): 	at android.content.res.Resources.getDrawable(Resources.java:713)
E/AndroidRuntime( 4728): 	at android.view.View.setBackgroundResource(View.java:15449)
E/AndroidRuntime( 4728): 	at fr.neamar.kiss.MainActivity.onCreate(MainActivity.java:4095)
E/AndroidRuntime( 4728): 	at android.app.Activity.performCreate(Activity.java:5231)
E/AndroidRuntime( 4728): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 4728): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2243)
E/AndroidRuntime( 4728): 	... 11 more
E/AndroidRuntime( 4728): Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2
E/AndroidRuntime( 4728): 	at android.content.res.TypedArray.getColor(TypedArray.java:327)
E/AndroidRuntime( 4728): 	at android.graphics.drawable.GradientDrawable.inflate(GradientDrawable.java:970)
E/AndroidRuntime( 4728): 	at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:965)
E/AndroidRuntime( 4728): 	at android.graphics.drawable.Drawable.createFromXml(Drawable.java:893)
E/AndroidRuntime( 4728): 	at android.content.res.Resources.loadDrawable(Resources.java:2117)
E/AndroidRuntime( 4728): 	... 17 more
W/ActivityManager(  976):   Force finishing activity fr.neamar.kiss/.MainActivity

bboa avatar Mar 26 '18 10:03 bboa

android.content.res.Resources$NotFoundException: File res/drawable/rounded_result_layout.xml

nmitsou avatar Mar 26 '18 10:03 nmitsou

Ah! The elusive ResourceNotFoundException!

I received a bunch of them in the PlayStore crash reporting tools, but was unable to identify the cause.

thanks for the report! That's definitely something we should fix (or if we can't, remove the option)

Neamar avatar Mar 26 '18 11:03 Neamar

@licaon-kter, @nmitsou, @Neamar, thanks.

bboa avatar Mar 26 '18 14:03 bboa

The same is happening on Android 4.1.2.

skbr18 avatar Mar 26 '18 22:03 skbr18

So, the issue happens on every pre-21 devices.

Root cause is https://github.com/Neamar/KISS/blob/97bc6459c0237a06db8ef46cff8119a990223598/app/src/main/res/drawable/rounded_search_bar.xml#L2-L6

As explained in https://stackoverflow.com/a/34279007, attributes references (?attr/) can't be resolved before Android 21 :\

So the solution would be to use a different drawable per theme.

Neamar avatar Mar 28 '18 19:03 Neamar

v3.0.8 should fix the problem :)

Neamar avatar Mar 28 '18 22:03 Neamar

Looks like 3.0.9 still have the problem, https://gist.github.com/bboa/d58b2014a48f62182064d0204c8f4596

bboa avatar Apr 01 '18 12:04 bboa

Damn. I think I messed up the branches, I'll double check this evening. Sorry :-\

On Sun, Apr 1, 2018, 13:45 Igor Nedoboy [email protected] wrote:

Looks like 3.0.9 still have the problem, https://gist.github.com/bboa/d58b2014a48f62182064d0204c8f4596

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/Neamar/KISS/issues/931#issuecomment-377784391, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgxDEiX51qKpWeENcwm9xep3TNmGxahks5tkMvLgaJpZM4S6XqL .

Neamar avatar Apr 01 '18 13:04 Neamar

Ah, I think I know what's going on. I fixed the issue for "rounded bars", but there is another issue for rounded list.... FML

Neamar avatar Apr 01 '18 21:04 Neamar

So... I sent another fix, because I did indeed miss the other option (.... too much :wine_glass: ?)

3.0.11 should hopefully work!

Neamar avatar Apr 01 '18 21:04 Neamar

Work!

bboa avatar Apr 08 '18 14:04 bboa

Yay! :)

Neamar avatar Apr 08 '18 16:04 Neamar