Scribe-Android icon indicating copy to clipboard operation
Scribe-Android copied to clipboard

app crashing at startup on api 30

Open MostafaMohamed2002 opened this issue 1 year ago • 15 comments

Terms

Behavior

when trying to launch the app on api 30 it crashes at startup

                 Process: be.scri.debug, PID: 11099
                 java.lang.RuntimeException: Unable to start activity ComponentInfo{be.scri.debug/be.scri.activities.SplashActivity}: java.lang.UnsupportedOperationException: Can't convert value at index 1 to color: type=0x1
                 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
                 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
                 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
                 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
                 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
                 	at android.os.Handler.dispatchMessage(Handler.java:106)
                 	at android.os.Looper.loop(Looper.java:223)
                 	at android.app.ActivityThread.main(ActivityThread.java:7656)
                 	at java.lang.reflect.Method.invoke(Native Method)
                 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
                 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
                 Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 1 to color: type=0x1
                 	at android.content.res.TypedArray.getColor(TypedArray.java:533)
                 	at android.app.Activity.onApplyThemeResource(Activity.java:5104)
                 	at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java:216)
                 	at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java:147)
                 	at android.app.Activity.setTheme(Activity.java:5082)
                 	at androidx.appcompat.app.AppCompatActivity.setTheme(AppCompatActivity.java:146)
                 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3415)
                 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601) 
                 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 
                 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
                 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
                 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) 
                 	at android.os.Handler.dispatchMessage(Handler.java:106) 
                 	at android.os.Looper.loop(Looper.java:223) 
                 	at android.app.ActivityThread.main(ActivityThread.java:7656) 
                 	at java.lang.reflect.Method.invoke(Native Method) 
                 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
                 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 

Device type

Pixel 9 pro api 30

Versions

latest

MostafaMohamed2002 avatar Oct 07 '24 14:10 MostafaMohamed2002

One of the reasons this is happening is because the App uses features only available for API 33 and above. We would have to give else conditions for Versions other TIRAMISU in the program for such features.

angrezichatterbox avatar Oct 07 '24 15:10 angrezichatterbox

@MostafaMohamed2002 , would you like to work on this after the current PR, or Can I try fixing the bug? :)

angrezichatterbox avatar Oct 10 '24 06:10 angrezichatterbox

@MostafaMohamed2002 , would you like to work on this after the current PR, or Can I try fixing the bug? :)

I will give it a try

MostafaMohamed2002 avatar Oct 10 '24 07:10 MostafaMohamed2002

Let us know if any support is needed, @MostafaMohamed2002 :)

andrewtavis avatar Oct 10 '24 07:10 andrewtavis

Hello @MostafaMohamed2002 did you reach a solution and PR is ready? :)

MahmoudMabrok avatar Nov 10 '24 23:11 MahmoudMabrok

Hello @MostafaMohamed2002 did you reach a solution and PR is ready? :)

No , if you want to contribute go on

MostafaMohamed2002 avatar Nov 11 '24 03:11 MostafaMohamed2002

@angrezichatterbox I think you can start checking issue when it is possible to you.

MahmoudMabrok avatar Nov 11 '24 05:11 MahmoudMabrok

Thanks for the discussion here, both of you! Please let us know if we can help somehow, @MahmoudMabrok :)

andrewtavis avatar Nov 11 '24 08:11 andrewtavis

Hey @MahmoudMabrok , I hope you're doing well. Just checking in to see if you are still working on the issue. Happy to help in case you're facing any issues.

angrezichatterbox avatar Jan 25 '25 16:01 angrezichatterbox

@angrezichatterbox I did not able to check it. if anyone can , please can he go.

MahmoudMabrok avatar Jan 26 '25 14:01 MahmoudMabrok

@angrezichatterbox Can I give a try ?

Akshaykomar890 avatar Jan 27 '25 13:01 Akshaykomar890

@angrezichatterbox Can I give a try ?

Yes Feel free to try out this issue :)

angrezichatterbox avatar Jan 27 '25 13:01 angrezichatterbox

@angrezichatterbox Sir, I checked my device's API, and it's 30. This is causing the error, but I can't come up with an idea on how to fix it. Can you suggest a way to resolve it ?

Akshaykomar890 avatar Jan 31 '25 18:01 Akshaykomar890

@angrezichatterbox Sir, I checked my device's API, and it's 30. This is causing the error, but I can't come up with an idea on how to fix it. Can you suggest a way to resolve it ?

It would look into it and get back to you :) . In the meantime, you are welcome to check the other issue using a simulator. Also, in this community, you are more than welcome to call me by my name rather than using sir 😄

angrezichatterbox avatar Feb 01 '25 08:02 angrezichatterbox

@MahmoudMabrok, given that others are having issues working with lower APIs, would you be able to give some suggestions here or potentially open a PR if the change is not too involved? :) Any help would be appreciated! 😊

andrewtavis avatar Feb 08 '25 15:02 andrewtavis

@andrewtavis I'll take it, if you don't mind.

linreal avatar May 21 '25 04:05 linreal

Assigned, @linreal! And seeing the PR as well 😊 Totally amazing and looking forward to the review! :)

andrewtavis avatar May 21 '25 07:05 andrewtavis

Closed by #402 🚀 Amazing to have this finalized! Thanks for the quick work, @linreal 😊

@angrezichatterbox and all: Do we need to factor in API <31 into testing in the future, or was this kind of a one off for this particular issue? What are the normal practices for testing across multiple APIs?

andrewtavis avatar May 21 '25 09:05 andrewtavis