thebigg73 / OpenSongTablet

Android port of OpenSong. Use your mobile device as a portable song book. Gareth Evans
GNU General Public License v3.0
32 stars 23 forks source link

OpenSong Crashes upon open #257

Closed Sorsnce closed 5 months ago

Sorsnce commented 6 months ago

Hello,

Recently Android updated and ever since then OpenSong will crash while opening the App. This appears to only affect all versions of 6.x. V5.6 does not have this issue. OpenSong has been working perfectly on 6.0.0 and 6.0.7 for many of months until last week. Please see below for details.


Hardware : Google Pixel Tablet Android Version : 14 Android security update : March 5, 2024 Bootloader version : tangorpro-14.4-11290827 Kernel version : 5.10.209-android13-4-g5944b4cc23fb Build number : 2024030900 OS : GraphenOS (without Google Play Services)

Debug log :

type: crash
osVersion: google/tangorpro/tangorpro:14/AP1A.240305.019.A1/2024030900:user/release-keys
package: com.garethevans.church.opensongtablet:372
process: com.garethevans.church.opensongtablet
processUptime: 3474 + 240 ms
installer: com.android.packageinstaller

android.view.InflateException: Binary XML file line #103 in com.garethevans.church.opensongtablet:layout/mode_performance: Binary XML file line #103 in com.garethevans.church.opensongtablet:layout/mode_performance: Error inflating class com.garethevans.church.opensongtablet.customviews.SongContent
Caused by: android.view.InflateException: Binary XML file line #103 in com.garethevans.church.opensongtablet:layout/mode_performance: Error inflating class com.garethevans.church.opensongtablet.customviews.SongContent
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.newInstance0(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
    at android.view.LayoutInflater.createView(LayoutInflater.java:742)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:894)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:849)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:1011)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:972)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:1014)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:972)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:1014)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:972)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:570)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:462)
    at f3.g1.c(SourceFile:5)
    at com.garethevans.church.opensongtablet.performance.PerformanceFragment.J0(SourceFile:2)
    at androidx.fragment.app.Fragment.n1(SourceFile:25)
    at androidx.fragment.app.l0.f(SourceFile:209)
    at androidx.fragment.app.l0.m(SourceFile:128)
    at androidx.fragment.app.e0.e0(SourceFile:348)
    at androidx.fragment.app.e0.p1(SourceFile:92)
    at androidx.fragment.app.e0.b0(SourceFile:22)
    at androidx.fragment.app.e0$f.run(SourceFile:4)
    at android.os.Handler.handleCallback(Handler.java:959)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loopOnce(Looper.java:232)
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8532)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ExecInit.main(ExecInit.java:49)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getVisibility()' on a null object reference
    at com.garethevans.church.opensongtablet.customviews.SongContent.getVisibility(SourceFile:3)
    at android.view.View.getSizePercentage(View.java:33058)
    at android.view.View.votePreferredFrameRate(View.java:33084)
    at android.view.View.invalidateInternal(View.java:20244)
    at android.view.View.invalidate(View.java:20229)
    at android.view.View.setFlags(View.java:17870)
    at android.view.ViewGroup.initViewGroup(ViewGroup.java:714)
    at android.view.ViewGroup.<init>(ViewGroup.java:707)
    at android.widget.LinearLayout.<init>(LinearLayout.java:254)
    at android.widget.LinearLayout.<init>(LinearLayout.java:250)
    at android.widget.LinearLayout.<init>(LinearLayout.java:246)
    at com.garethevans.church.opensongtablet.customviews.SongContent.<init>(SourceFile:1)
    ... 32 more
thebigg73 commented 6 months ago

Hi,

Many thanks for including the crash log - it gives me a clue and somewhere to start. The SongContent is a custom view where the 1,2 or 3 columns are created for the song display. The getVisibility() code mentioned should only be called internally on the view and shouldn't be based on a null view (the layout). I've put in a few tests to check for null views as it could be that the view is being checked on first boot before it is fully set up. I will be releasing the new version either tonight or tomorrow. Could you test that version please and let me know if this fixes the issue for you, but if not, could you give me an updated crash log.

Many thanks for taking the time to help fix this.

Gareth

Sorsnce commented 6 months ago

Yup will do!

Sorsnce commented 6 months ago

So same issue with v6.0.8.... For the life of me can't get a debug crash message though.... But I do think I know what the issue is, I believe I am seeing the crash due to an upstream change with Android 14 QPR2. I believe any device running this quarterly patch will see this issue. This is also happening on my Pixel 7 pro with and without google play services running. See below on some details on why this patch broke many apps.....

Version : Android 14 QPR2

Release not changes : DocumentsUI (Files): work around crashes caused by QPR2 R8 changes resulting in code used via reflection being removed

Source : https://grapheneos.org/releases#2024030800