TeamAmaze / AmazeFileManager

Material design file manager for Android
https://teamamaze.xyz
GNU General Public License v3.0
5.35k stars 1.58k forks source link

Add support for WSA (Windows Subsystem for Android) #2969

Open richardhttps opened 3 years ago

richardhttps commented 3 years ago

Issue explanation (write below this line)

I installed Amaze on WSA (Windows Subsystem for Android) and the app crashed on launch, showing me the error report below.

Exception

java.lang.RuntimeException: Unable to resume activity {com.amaze.filemanager/com.amaze.filemanager.ui.activities.MainActivity}: java.lang.NullPointerException: null cannot be cast to non-null type android.hardware.usb.UsbManager
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4438)
    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4470)
    at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7664)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.NullPointerException: null cannot be cast to non-null type android.hardware.usb.UsbManager
    at com.amaze.filemanager.utils.OTGUtil.getMassStorageDevicesConnected(OTGUtil.kt:198)
    at com.amaze.filemanager.ui.activities.MainActivity.updateUsbInformation(MainActivity.java:1290)
    at com.amaze.filemanager.ui.activities.MainActivity.onResume(MainActivity.java:1282)
    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1456)
    at android.app.Activity.performResume(Activity.java:8129)
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4428)
    ... 11 more


EmmanuelMess commented 3 years ago

Place crashes relating to WSA in an issue, then reference it here.

EmmanuelMess commented 3 years ago

@richardnassour Can you please test an APK for us? app-play-debug.zip

Please report if you keep finding this bug and if you find any others please create issues for them, thanks!

richardhttps commented 3 years ago

@richardnassour Can you please test an APK for us? app-play-debug.zip

Please report if you keep finding this bug and if you find any others please create issues for them, thanks!

It opened this time, but crashed again when I responded to the "Grant SAF access" prompt. I recorded it on video. https://user-images.githubusercontent.com/33163707/139574857-70d81701-5351-40f1-81c2-dc7bde1a96c9.mp4 Error report: https://pastebin.com/yH7uNhYC

VishalNehra commented 3 years ago

Reopening this in response to adding support for this. Temporary bypassing the crash should be tracked with #2955

EmmanuelMess commented 3 years ago

@richardnassour Can you please test an APK for us? app-play-debug.zip Please report if you keep finding this bug and if you find any others please create issues for them, thanks!

It opened this time, but crashed again when I responded to the "Grant SAF access" prompt. I recorded it on video. user-images.githubusercontent.com/33163707/139574857-70d81701-5351-40f1-81c2-dc7bde1a96c9.mp4 Error report: pastebin.com/yH7uNhYC

That error is already being tracked #2876 and has a fixing PR.

I will however create a new issue for fixing the fact that there are no storages in WSA.