The scenario is that my app is creating some files on its external storage /sdcard/Android/data/myPackageName and during testing automation I need to retrieve some files from that folder using adb.
The compileSdkVersion and targetSdkVersion are set to 31, and also uses:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
For some reasons, the adb pull command doesn't work (permission denied) on Android 11 but it works on Android 13 (I used real phones not emulators)
These are the mount points:
Android 13
/dev/block/dm-40 on /storage/emulated/0/Android/data type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,checkpoint_merge,fsync_mode=nobarrier,discard_unit=block)
Android 11
/dev/block/dm-12 on /storage/emulated/0/Android/data type f2fs (rw,lazytime,seclabel,nosuid,nodev,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,reserve_root=32768,resuid=0,resgid=1065,inlinecrypt,alloc_mode=default,fsync_mode=nobarrier)
(the only differences are: discard_unit=block and checkpoint_merge)
I read a lot of SO posts, Android documentation etc and but I wasn't able to figure out the reason why this is happening. Why it works on 13 and not on 11? Any idea?
Related
According to
https://developer.android.com/guide/topics/connectivity/bluetooth/permissions
There are need to grant permission manually to handle bluetooth for android 12 (API level > 30)
uses-permission android:name="android.permission.BLUETOOTH_SCAN"
uses-permission android:name="android.permission.BLUETOOTH_CONNECT"
But according to
https://reactnative.dev/docs/0.62/permissionsandroid
These two PermissionsAndroid in RN 0.62 are not available and only available for RN ^0.66 causing error permission is null.
Is there any solution to use these permission in RN 0.62?
There are one way to go around it....
Upgrade the target or compileSDK (don't remember exactly which one - but since you are already working with android 12, I'm assuming you've already set it to sdk 30), use a package like https://www.npmjs.com/package/react-native-permissions
Or....... Upgrade your entire app to latest react native version (I recently upgraded my two projects from react native 0.63 to latest and it was pure chaos and pain :) - nah just exaggerating, it feels so great to have your apps on latest version)
I have an App that has to access external storage (logs, etc), and it stopped working since I updated it to Android 10. I found a workaround to set
android:requestLegacyExternalStorage="true"
and it works fine on Android 10 now, but not on Android 11. I heard that this should still work on Android 11 if my app is targeting android 10 (SDK 29), so in my case, it should work. But it doesn't, and I still get deployment failed, permission denied
Is it possible to read the volume level of an android device?
There are 3 different volumes: Ringtone, music and alarm. I would like to find, if the music is muted.
I've already tried AudioManager, but it doesn't seem to work properly on android SDK version 10 (if it works fine on your device, please let me know).
I've searched a lot and nothing seems to work, any suggestion will be appreciated 😉
Android Q has changed the way applications access files in the external storage.
Before your app is fully compatible with scoped storage, you can temporarily opt out by using one of the following methods:
Target Android 9 (API level 28) or lower.
If you target Android 10 (API level 29) or higher, set the value of
requestLegacyExternalStorage to true in your app's manifest file:
<manifest ... >
<!-- This attribute is "false" by default on apps targeting
Android 10 or higher. -->
<application android:requestLegacyExternalStorage="true" ... >
...
</application>
</manifest>
For more details you could check Google Docs .
I have been trying to share an image with the datashare ANE with FlashDevelop: http://www.adobe.com/devnet/air/articles/datashare-native-extension.html
At first, it was working great (AIR 24), but since I updated the AIR sdk (I am using AIR 26), it doesn't seem to work anymore. I get this:
[Fault] exception, information=Error: Error #3001: File or directory access denied.
in flash.filesystem::FileStream/open
But my application.xml file already has
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
It seems to be coming from the Android version, since it works on on old phone running android 4.4.4. It doesn't work on Android 7.0. Any help?
Thanks!
i took an android project and imported it in eclipse. in properties->android section it is showing platform 1.6 and API level 4. I have downloaded Android 2.2. Now when i try to make some changes in the source code and make an .apk file and try to install on my android device the device shows an error : Application not installed. the project is not showing any error but it is showing a warning : Attribute minSdkVersion (3) is lower than the project target API level (4) in manifest file. the person who gave me th eproject i asked him to mail his .apk file to me and that .apk file is running perfectly on the device. Please advice.
Change to API level 3 (Android 1.5), that must be the solution. you must have in your manifest.xml defined a minSdkVersion = 3
</application>
<uses-sdk android:minSdkVersion="3" />
</manifest>
or change the minSdkVersion to Api level 4 at your manifest.xml file that correspond to android 1.6
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
build, create and sign your .apk again
alternatively you could try this:
when application run on emulator it creates an .apk file on project/bin folder. you just connect your android phone with usb mass storage and then copy this apk to SD card. it will then install the app on phone by clicking the apk file on phone. i've faced the same problem and now i've successfully installed my apps on t mobile G1.