Android Question Blank screen when app starts with Oppo54

Mattiaf

Active Member
Licensed User
Hi guys,
is there any reason why a working app ( on samsung galaxy s21+ with android 13, samsung a21 with android 12) results completely blank when opened with an Oppo a54 with android 12? my app doesn't require any permission and the log are completely fine, same as the working devices..
Video record
If you need, I can attach the entire project too.
Much thanks
 
Last edited:

jahswant

Well-Known Member
Licensed User
Longtime User
 
Upvote 0

Mattiaf

Active Member
Licensed User
I think it's a bit old
because I used a b4x page with the following code

B4X:
#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region

'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip

Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private logs As StringBuilder
    Private logcat As LogCat
    Private const emailAddress As String = "my gmail email "
    Private Timer1 As Timer
End Sub

Public Sub Initialize
'    B4XPages.GetManager.LogEvents = True
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    logs.Initialize
#if RELEASE
    logcat.LogCatStart(Array As String("-v","raw","*:F","B4A:v"), "logcat")
#end if
    Timer1.Initialize("timer1", 1000)
    Timer1.Enabled = True
   
End Sub
Private Sub Timer1_Tick
    Log($"Current time: $Time{DateTime.Now}"$)
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Private Sub Button1_Click
    Log("Trying to set 'i'...")
    'this line will crash the program
    Dim i As Int = "fdgdfg" 'ignore
End Sub
Private Sub logcat_LogCatData (Buffer() As Byte, Length As Int)
    logs.Append(BytesToString(Buffer, 0, Length, "utf8"))
    If logs.Length > 5000 Then
        logs.Remove(0, logs.Length - 4000)
    End If
End Sub

'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    'wait for 500ms to allow the logs to be updated.
    Dim jo As JavaObject
    Dim l As Long = 500
    jo.InitializeStatic("java.lang.Thread").RunMethod("sleep", Array(l))
    logcat.LogCatStop
    logs.Append(StackTrace)
    Dim email As Email
    email.To.Add(emailAddress)
    email.Subject = "Program crashed"
    email.Body = logs
    StartActivity(email.GetIntent)
    Return True
End Sub

and it doesn't let me choose any email app, it just close the app . .
 
Last edited:
Upvote 0

Mattiaf

Active Member
Licensed User
Same thing with the following code, it won't open the intent....

B4X:
#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region

'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip

Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private logs As StringBuilder
    Private logcat As LogCat
    
    Private Timer1 As Timer
    
End Sub

Public Sub Initialize
'    B4XPages.GetManager.LogEvents = True
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    logs.Initialize
#if RELEASE
    logcat.LogCatStart(Array As String("-v","raw","*:F","B4A:v"), "logcat")
#end if
    Timer1.Initialize("timer1", 1000)
    Timer1.Enabled = True
    
End Sub
Private Sub Timer1_Tick
    Log($"Current time: $Time{DateTime.Now}"$)
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Private Sub Button1_Click
    Log("Trying to set 'i'...")
    'this line will crash the program
    Dim i As Int = "fdgdfg" 'ignore
End Sub
Private Sub logcat_LogCatData (Buffer() As Byte, Length As Int)
    logs.Append(BytesToString(Buffer, 0, Length, "utf8"))
    If logs.Length > 5000 Then
        logs.Remove(0, logs.Length - 4000)
    End If
End Sub

'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    'wait for 500ms to allow the logs to be updated.
    Dim jo As JavaObject
    Dim l As Long = 500
    jo.InitializeStatic("java.lang.Thread").RunMethod("sleep", Array(l))
    logcat.LogCatStop
logs.Append(StackTrace)
    
Dim in As Intent
in.Initialize("android.intent.action.SENDTO", "mailto:")
in.PutExtra("android.intent.extra.EMAIL", Array As String("my email gmail "))
in.PutExtra("android.intent.extra.SUBJECT", "Some Subj")
in.PutExtra("android.intent.extra.TEXT",  logs)

StartActivity(in)
        
        
    
        Log("SendEmail " & LastException)
        
    
    Return True
End Sub
 
Upvote 0

Mattiaf

Active Member
Licensed User
Both codes will work if I remove
B4X:
  Dim i As Int = "fdgdfg" 'ignore
and I send the email through the button... I assume Sub Application_Error is not being raised in both codes. . .. Any idea?
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
Integrate Firebase crashlytics
 
Upvote 0

Mattiaf

Active Member
Licensed User
Integrate Firebase crashlytics
I'm looking for it but i don't understand if I will be the person who will receive the crash logs from the other phone..If yes, where am i going to receive it?
I think things are getting harder despitre the issue.. I might consider to connect that phone to my laptop, or to solve with the first method suggested... But why Sub Application_Error is not being raised?? What am i doing wrong..
 
Upvote 0

watesoft

Active Member
Licensed User
Longtime User
Hi guys,
is there any reason why a working app ( on samsung galaxy s21+ with android 13, samsung a21 with android 12) goes in crash with an Oppo a54 with android 12? my app does lnt require any permission and it is impossible for me to test the logs of that phone, unless exist a way to see the log through distance..
If you need, I can attach the entire project too.
Much thanks

I also encountered this situation not long ago. It is an OPPO phone running Android 12. Although my app does not require special permission,However, when installing on this phone, a permission dialog box similar to POST_NOTIFICATIONS will pop up. I must allow,If I refuse, the app will crash
 
Upvote 0

Mattiaf

Active Member
Licensed User
hi guys, today I tried to connect that phone through b4a bridge to check any log... and well.... the app doesnt crash!! it just open a white page and it stays in there.. b4a create the events normaly like the app is working fine, but it doesnt move from there...... any idea? my app doesnt require ANY permission.. I ve tried my app in differents phone with differents android versions and it doesnt have any issue....
 
Upvote 0

Mattiaf

Active Member
Licensed User
yes, as I said before, I brought the laptop to my friend house, connect his oppo phone through b4a bridge and realized nothing is crashing and the logs are perfectly fine like in all the phones where my app is working. I compared the logs with the oppo phone to my samsung s20+. They are identical.. Just the screen stays white when app starts.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
It looks like a permission issue. have you set something in the manifest? do you have a small project crashed in oppo ?
 
Upvote 0

Mattiaf

Active Member
Licensed User
no i didnt set anything in the manifest, i m not asking any permission plus there isnt any dialog of permission asking at the beginning... nothing is crahing, it stays just like that
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
From the video it looks that there is something gray on the screen.
Could it be a layout problem?
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Maybe similar issue here:
 
Upvote 0
Top