Android Question App works ok on Android 9, crashes on Android 11 and 12 while scrolling

Sifu

Active Member
Hello,

an app where I'm working on runs ok on Android 9, but crashes on Android 11 and 12 emulators (10 I could not test).
This happens while scrolling down to the last loaded image, and when reached it crashes (but not on Android 9).
An no error is given in the filtered logs.

I'm not accessing any folders or whatever and I think it has nothing to do with permissions. I'm using latest B4A and Java 11 on Win10.
When there is only one image loaded, there is nothing to scroll and then it does not crash.

B4X:
Sub FillCLV
    Log("start FillCLV")
    clv1.Clear
    TrkImage.Initialize("")
    
    Dim sources1 As List
    sources1.Initialize
    
    'playerJ.Prepare(playerJ.CreateListSource(sources1))
        
    Dim trackpic As String
    If albumtrackpics.IsInitialized Then                  'all of a sudden it gave an initialization error and I needed this, while it was working OK before.
    Log("albumtrackpics= " & albumtrackpics.Get(0))
    For i = 0 To albumtrackpics.Size -1
        trackpic = albumtrackpics.Get(i)
        Log("trackpic= " & trackpic)
        'playerJ.Initialize("playerJ")
        playerJ.Prepare(playerJ.CreateListSource(sources1))
        Dim p1 As B4XView = CreateItem((0xFF000000), TrkImage, playerJ)
        clv1.Add(p1,"")
    Dim tr As Int
    tr = i + 1              'there is no 0.mp3 so add 1
        DownloadImage(trackpic, TrkImageView)             'correct name is in albumtrackpics.Get(i)
        sources1.Add(playerJ.CreateUriSource("https://trackshere.com/albumtracks/" & albumnamempthree & "/" & tr & ".mp3"))
    Next
    End If
End Sub

Sub CreateItem(clr As Int,  trkimg As ImageView, player As B4XView) As B4XView
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, clv1.AsView.Width,260dip) ', clv1.AsView.Height)
    p.LoadLayout("clvfront")

    TrkImageView.Bitmap = trkimg.Bitmap
    
    SimpleExoPlayerView1.Player = player
    SimpleExoPlayerView1.Tag = player
    ''''''SimpleExoPlayerView1.RemoveView
    ''''''SimpleExoPlayerView1.UseController = False
    VideoPlayers.Put(SimpleExoPlayerView1, True)
    Dim jo As JavaObject = SimpleExoPlayerView1    'this stops controlbuttons from fading away on player
    jo.RunMethod("setControllerShowTimeoutMs", Array(0))
    jo.RunMethod("setControllerHideOnTouch", Array(False))
    Return p    
End Sub

I attached the unfiltered logs, hopefully someone can see what I should alter/add to the script.

Thanks for any help.

(next to this I have a question about the player(s) starting simultaneously, but I will try some more and else ask in a new thread)
 

Attachments

  • crash android 12 unfiltered.txt
    55.5 KB · Views: 174

agraham

Expert
Licensed User
Longtime User
Force finishing activity nl.test.testapp/.music
I assume this is your app. It is failing due to a memory segment error in your apps render thread that draws the UI. This is so deeply low level it is unlikely to be anything you are doing, As Erel says it may well be an emulator issue.
 
Upvote 0

Sifu

Active Member
I could have done that before I reported it..... Getting so used to the emulator as it's quite fast and stable so therefore I did not expect it to be a problem of the emulator.
Installed it on my Xioami Android 11 and it does not crash.

Thanks!
 
Upvote 0
Top