App.json debug mode. permissions?


#1

I want to ask if the app.json config loaded in debug mode.

I specify my android as so:

    "android": {
      "versionCode": 6,
      "package": "-=-=-=-=-=-=-=-=-=-",
      "config" : {
        "googleMaps" : {
          "apiKey": "-=-=-=-=-=-=-=-=-=-"
        }
      },
      "permissions" : [
        "CAMERA",
        "ACCESS_FINE_LOCATION",
        "READ_EXTERNAL_STORAGE",
        "ACCESS_COARSE_LOCATION",
        "com.htc.launcher.permission.READ_SETTINGS",
        "MANAGE_DOCUMENTS",
        "com.sonyericsson.home.permission.BROADCAST_BADGE",
        "WRITE_EXTERNAL_STORAGE"
      ]
    }

But notice that I kept having permission error:
[Error: Could not get photos: need READ_EXTERNAL_STORAGE permission]
I also tried:

            const { Permissions } = Expo;
            const { status } = await Permissions.getAsync('READ_EXTERNAL_STORAGE');
            if (status !== 'granted') {
                await Permissions.askAsync("READ_EXTERNAL_STORAGE");
                if (status === 'granted') {
                    return true;
                } else {
                    throw new Error('Location permission not granted');
                }
            }

but I am getting:
Error: Unrecognized permission READ_EXTERNAL_STORAGE

Do I need to detach my expo for this?

Cheers


#2

Hi-

Yeah, you’ll need to detach/eject unfortunately if you want to read from external storage I think. What are you trying to do? Just read off some connected memory card?
You can submit a feature request or vote on them at https://expo.canny.io/feature-requests

The permissions you can ask for in Expo are documented here:
https://docs.expo.io/versions/v19.0.0/sdk/permissions.html#content


#3

Thanks @ccheever,

I am trying to implement camera, gallery view. and that error shows on my logs.
I saw that documentation, and I think the options are very limited.

If I detach, should linking still work? or should I relink everything? TIA.

Thanks.


#4

If you detach, you can react-native link. You have to do it after you detach though.
I’m not totally sure I’m answering your question so let me know if I’m confused.


#5

Hi @jatazoulja,

I got same issue, and resolved by added:

android.permission. before each permissions, for instance:

      "permissions": [
        "android.permission.CAMERA",
        "android.permission.READ_EXTERNAL_STORAGE",
        "android.permission.WRITE_EXTERNAL_STORAGE",
        "android.permission.READ_INTERNAL_STORAGE",
        "android.permission.WRITE_INTERNAL_STORAGE",
        "android.permission.MANAGED_DOCUMENTS",
        "android.permission.CHANGE_CONFIGURATION",
        "com.google.android.c2dm.permission.RECEIVE",
        "com.android.launcher.permission.INSTALL_SHORTCUT",
        "com.htc.launcher.permission.UPDATE_SHORTCUT"
      ]

Maybe he can help you :wink:


MapView not working in app released to play store
#6

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.