Android Question Rejection from Samsung Store due to stopping app

Sifu

Active Member
Hi,
after almost 2 weeks I got a rejection from Samsung.
The app seems to stop after pressing power and unlocking the device.
I do not see this behaviour on my Android 11, and not on the emulator.
On my phone the music just plays in the Exoplayer, even when pressed on the Power button.
I will try to install Android 12 emulator and see if it replicates this behaviour.
Apparently it looks like they are testing on a Samsung S21 Android 12.
Seems like they press the screen and then power at the same time. (not totally sure if they exactly do that, but it seems like it)
When pressing log on an image in the app it opens a website with external browser, maybe that's why it is acting strange when you press power at the same time. I'll have to ask them if that is the case. (why would one do that)

this is part of the report
B4X:
[Defect]
App is force closed after unlocking the lock screen

[Procedure]
1. Execute the app
2. Play a song - HOLD KEY - Release Hold mode - check: app is force closed

[Expected Result]
App should work properly without force closing after unlocking the lock screen
[Test Device Info]
Detected Device: SM-G996B, SW Version: G996BXXU4BULF_Android Ver: 12
Is it a Force Stop or is it a crash?
Any idea?
Thanks a lot.
 

Sifu

Active Member
Hi,
This is part of the answer I've got returned from Samsung after requesting for a log file for just the app.
Thank you for contacting us. We appreciate the opportunity to assist you.

Regarding your inquiry, we would regrettably inform you that we cannot investigate further for lacking information.
Now what I did get with the first report is a 9MB zip which contains an around 80MB log file in which I searched for the name of the app to find any clues.
***edit*** indeed I do see some things concerning my app.
If you're interested I can send it to you. But I prefer not to upload it in public.

I'd like to test it myself too on Android 12 Emulator, but it gets terminated while starting.
The Android 11 Emulator works without problem. But it seems more people have that problem that running Android 12 gets terminated. HAXM for x86 is correct installed.(latest version 7.7.0 from Intel)
My Xiaomi phone is also Android 11, no problems running the app.

Note that I've no rejection from Google or Amazon.
Thanks a lot.
 
Upvote 0

Sifu

Active Member
There was an update today of the Android emulator in Android Studio, so now finally Android 12 keeps running.
I have not seen the same crash behaviour yet of the app.
Where can I find a log of the app in the emulator?

Maybe it has to do something with the screen lock and resuming the app. I have to see, maybe I have to change something.

Thank you
 
Upvote 0

Sifu

Active Member
I've tested with Real device and emulator Android 11. No issues.
The test on Android 12 emulator, dragged apk to it. Crashes on different occasions, like simple scrolling.
Tried via debug from B4A, same different crashing and also disconnects, so no errors in log.
Changed Targetsdk from 30 to 31 to see if that would cause any change, then I got this error:
B4X:
adb: failed to install result_RAPID_DEBUG.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during
 installPackageLI: /data/app/vmdl396752238.tmp/base.apk (at Binary XML file line #130):
 anywheresoftware.b4a.objects.FirebaseNotificationsService: Targeting S+ (version 31 and above) requires that an explicit value for
 android:exported be defined when intent filters are present]
I've searched on forum and google, not clear how to use it.
How do I add android:exported correctly to the manifest to be able to test?
Thanks.
 
Upvote 0

Sifu

Active Member
You should set targetSdkVersion to 30 for now.
Yes I know, I just wanted to try higher for the sake of testing, to see if it makes any difference.

But I think I found something in the logs. The mp4 they send with the dumpstate shows that the error pops up after pressing power off and on and then unlock.
According here https://source.android.com/setup/contribute/read-bug-reports

Power​

The event log contains screen power status, where 0 is screen off, 1 is screen on, and 2 is for keyguard done.

So I searched for it:
B4X:
01-21 16:03:11.785  1000  1289  1289 I screen_toggled: 1
|
|
01-21 16:03:11.869  1000  1289  4039 I wm_set_keyguard_shown: [1,0,0,setKeyguardShown]
Then searched down until I found start of crash until completely finished(I removed a bunch of lines in between not directly related to the app):
B4X:
01-21 16:03:14.081  1000  1289  2197 I am_crash: [29599,0,com.myapp.myapp,814267972,java.lang.RuntimeException,Object should first be initialized (B4XView).,AbsObjectWrapper.java,67]
|
|
01-21 16:03:14.088  1000  1289  2197 I wm_finish_activity: [0,112815928,18,com.myapp.myapp/.music,force-crash]
|
|
01-21 16:03:14.094  1000  1289  2197 I wm_pause_activity: [0,112815928,com.myapp.myapp/.music,userLeaving=false,finish]
|
01-21 16:03:14.118  1000  1289  1570 I input_focus: [Focus leaving 4b7a305 com.myapp.myapp/com.myapp.myapp.music (server),reason=NO_WINDOW]
|
|
01-21 16:03:14.169  1000  1289  1371 I input_focus: [Focus request c4b21e0 Application Error: com.myapp.myapp,reason=UpdateInputWindows]
|
|
01-21 16:03:14.232  1000  1289  1570 I input_focus: [Focus entering c4b21e0 Application Error: com.myapp.myapp(server),reason=Window became focusable. Previous reason: NOT_VISIBLE]
|
|
01-21 16:03:14.595  1000  1289  1370 I wm_add_to_stopping: [0,112815928,com.myapp.myapp/.music,completeFinishing]

How to figure out which Object should be initialized? Because in B4A I don't get such error message.

If I'm correct interpreting it, it is a B4Xview which is not initialized.
if so, maybe strange why it is not happening on Android 11
 
Upvote 0

Sifu

Active Member
On the other hand, when added via designer they should not be initialized.
I removed 3 initialisations, which should not be there. Giving me new errors but now in B4A log panel.
Maybe it is related, I'm not sure.
error:
B4X:
Error occurred on line: 46 (B4XPrivacyPage)
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
The error is in this sub:
B4X:
Sub Activity_Create(FirstTime As Boolean)    
    'PrivacyLabel2.Initialize("PrivacyLabel2")          'log says not to inititalize, but if not then opening the  privacy page crashes the app
    PrivacyLabel2.Color=Colors.RGB(0,0,0)'purple 33,0,127
    PrivacyLabel2.TextColor=Colors.White
    
    obj1.Target = ScrollView1 
    Dim args(3) As Object
    args(0) = PrivacyLabel2
    args(1) = -1
    args(2) = -2
    Dim types(3) As String
    types(0) = "android.view.View"
    types(1) = "java.lang.int"
    types(2) = "java.lang.int"
    obj1.RunMethod("removeAllViews")
    obj1.RunMethod4("addView", args, types)                       'this line is line: 46
    LoadText
End Sub

No doubt I myself am the culprit making a mistake :)
 
Upvote 0
Top