PhenoApps / Field-Book

https://fieldbook.phenoapps.org
GNU General Public License v2.0
52 stars 54 forks source link

[BUG]: crash during storage definer #980

Closed Tv1dis closed 4 months ago

Tv1dis commented 5 months ago

Description

When I open the app, I see a text telling me "The latest version of android requires users [...] for each app to access" and a button to "define". But when I click it, nothing happens or the application crash

Android version : 13 TKQ1.221114.001 OS version : 1.0 1.0 TGKEUXM

WhatsApp Image 2024-06-06 at 13 11 05

Expected behavior

No response

Field Book version

5.5.24

trife commented 5 months ago

@Tv1dis Can you download the latest version from the GitHub releases to test? What device model are you using?

Tv1dis commented 5 months ago

Hi @trife , I did it but the problem persists here. I use the SmartPhone Xiaomi Redmi Note 11 2201117TY 6.4

trife commented 5 months ago

@chaneylc here's the crash log and a potential fix

@Tv1dis we'll try one of these fixes but this device may not be compatible due to how Redmi has set up their version of Android.

Fatal Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.OPEN_DOCUMENT_TREE }
       at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2257)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1872)
       at android.app.Activity.startActivityForResult(Activity.java:5669)
       at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:728)
       at androidx.core.app.ActivityCompat$Api16Impl.startActivityForResult(ActivityCompat.java:860)
       at androidx.core.app.ActivityCompat.startActivityForResult(ActivityCompat.java:249)
       at androidx.activity.ComponentActivity$2.onLaunch(ComponentActivity.java:243)
       at androidx.activity.result.ActivityResultRegistry$2.launch(ActivityResultRegistry.java:175)
       at androidx.fragment.app.Fragment$10.launch(Fragment.java:3621)
       at androidx.activity.result.ActivityResultLauncher.launch(ActivityResultLauncher.java:47)
       at org.phenoapps.security.SecureOpenDocumentImpl$openTree$1.invoke(SecureOpenDocumentImpl.kt:35)
       at org.phenoapps.security.SecureOpenDocumentImpl$openTree$1.invoke(SecureOpenDocumentImpl.kt:31)
       at org.phenoapps.security.SecureFragmentImpl.withPermission(SecureFragmentImpl.kt:52)
       at org.phenoapps.security.SecureOpenDocumentImpl.withPermission(SecureOpenDocumentImpl.kt:70)
       at org.phenoapps.security.SecureOpenDocumentImpl.openTree(SecureOpenDocumentImpl.kt:31)
       at org.phenoapps.security.SecureDefineDocumentTreeImpl.defineDocumentTree(SecureDefineDocumentTreeImpl.kt:32)
       at org.phenoapps.fragments.storage.PhenoLibStorageDefinerFragment.launchDefiner(PhenoLibStorageDefinerFragment.kt:117)
       at org.phenoapps.fragments.storage.PhenoLibStorageDefinerFragment.onViewCreated$lambda$0(PhenoLibStorageDefinerFragment.kt:84)
       at org.phenoapps.fragments.storage.PhenoLibStorageDefinerFragment.$r8$lambda$aO8F9lfUBCnmEtHVkuSYxoah5tI()
       at org.phenoapps.fragments.storage.PhenoLibStorageDefinerFragment$$ExternalSyntheticLambda0.onClick(:2)
       at android.view.View.performClick(View.java:7600)
       at android.view.View.performClickInternal(View.java:7577)
       at android.view.View.-$$Nest$mperformClickInternal()
       at android.view.View$PerformClick.run(View.java:30186)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:211)
       at android.os.Looper.loop(Looper.java:300)
       at android.app.ActivityThread.main(ActivityThread.java:8503)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
Tv1dis commented 5 months ago

@trife I formatted my phone and it seems to work. Thanks for your help