NullPointerException: Attept to invoke virtual method 'android.content.pm.PackageManager' on a null object
This says nothing about the problem. In fact, https://github.com/termux/termux-app/blob/master/app/src/main/java/com/termux/app/RunCommandService.java doesn't use
android.content.pm.PackageManager at all.
Permissions request wasn't in the right place. My bad, it works fine, thanks for the refference!
Fixing may require
MANAGE_EXTERNAL_STORAGEpermission - not tested currently.
Note on storage @xeffyr The description corresponds only partially to my experience. The reference to Android 11 can refer to the OS of the device/emulator or targetSdk=30 from termux, includes Android 10 or a combination thereof. With targetSdk=28 I didn't have a problem with writing and deleting on any OS and no real difference between internal memory and sdcard was found.
That changes fundamentally with targetSdk=29! Apart from the now meaningless setup-storage dialog, termux can only manage
~/../../* data. With the appropriate files app I can exchange/duplicate data with termux on my devices, termux is then mostly too big with 3-5Gb and very randomly what happens on the extern/internal-storage
This restriction is more severe than the Exec restriction, which can be bypassed with proot-exec. Has there been any progress with