Android Question Widget in targetSdkVersion="31"

davfla

Member
Licensed User
Longtime User
Hi all,

I've been trying for days now and can't get any further.

Since the forced update to Android Target API 31 in the Playstore, I get the following error message on devices with Android >= 12 when adding or remove the widget to/from the homescreen :
After the error comes, the app takes about 2 minutes when you want to open it again. Sometimes Crash Window from Android also comes. The error is reproducible.

This also applies to Erel's example, which should serve as a guide to creating a widget.

I did not change anything in the example except the target version in the manifest. Then in this example the error comes as well.
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="31" />

What I have already tried :
- B4A 12.00 Beta included Core 11.81 with Android-33
- All possible variants with Service.AutomaticForegroundMode including removing the function and Service.StopAutomaticForeground in all variants.
- Android API 30 = No problem, Android API 31 = Failure, API 33 = Failure
- The problem is also in the live version of my app according to Google Play Console and not only with emulator devices.

What I also wonder why apparently no one else has this problem ? I have not found another thread about it. Am I perhaps doing something wrong ?
 

davfla

Member
Licensed User
Longtime User
Hi Erel,

thank you very much for your answer. Unfortunately, I can not see any change. It does not solve the problem.
- All possible variants with Service.AutomaticForegroundMode including removing the function and Service.StopAutomaticForeground in all variants.

I had attached the example.

David
 

Attachments

  • HomeWidgets.rar
    402 KB · Views: 172
Upvote 0

agraham

Expert
Licensed User
Longtime User
My God! This is so frustrating. Microsoft manages decades of backwards compatibility but Google just breaks s??t with each release. I really wish there was a viable mobile platform other than Android (and no it's not Apple).
 
Upvote 0

davfla

Member
Licensed User
Longtime User
I'm glad you see the error now too. I already wanted to make a video Then I'm now waiting to see if you find a solution and also search.

@agraham : I think in hell is extra a place for such developers at Google who make such nonsense.
 
Upvote 0

ilpesce

Member
Licensed User
Longtime User
add this permission
 
Upvote 0

davfla

Member
Licensed User
Longtime User
Hello ilpesce,

thank you for the suggestion. Unfortunately, this does not solve our problem when the widget is removed again. I have created a video here, which should show what exactly I mean. Included your suggestion.


However, the error probably does not occur only when the widget is removed. The many crashes of my live app speak for this.
So I am very grateful for your suggestion and would like to try other opinions about it.

David
 
Upvote 0

ilpesce

Member
Licensed User
Longtime User
Hello
I understand, my application gave a similar error only to the first widget inserted after installation then the following were ok.
I solved this by entering the aforementioned permission.
I recommend that you use a real device for testing.
every year it gets worse and worse ...
 
Upvote 0

davfla

Member
Licensed User
Longtime User
Hello ilpesce,

unfortunately I can not confirm this. I have now tried it on a real Device Samsung Galaxy A52s with Android 12. Installed via the B4A Bridge and read out with #Bridgelogger: True. And the result is exactly the same.
Edit : Permission was used.

Fortunately, only an "internal" error message is thrown and the user does not notice anything.

The problem is that this error is transmitted to Google. In the future, Google plans to display the performance statistics in the Playstore with how the app works with the respective device. And that will look disastrous with a B4A widget usage with this error. Here is an example how it can look




>750 crashes ( ~150 users from ~8000) in 15 days is a hefty amount

But thanks for your suggestion.

David
 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
In the future, Google plans to display the performance statistics in the Playstore

The Play Store will start applying store listing warnings on November 30, 2022.
Also apps will get lower visibility on store and will be excluded from trending categories.

Full text:
 
Upvote 0

PJLPJLPJL

Member
Licensed User
I hope this is helpful. I had some very similar problems after updating my widget program to TargetSDK 31 and added the permission mentioned above without improving things. However, when I uninstalled and reistalled my app it all worked perfectly.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…