Permissions always "denied" on standalone app usinbg SDK 32

Experiencing issues with Calendar, Notifications and Camera Roll permissions on android after upgrading to SDK 32 and building apps using expo build.

While running apps using expo client the permission dialog shows and works as expected.

But when running built apps in android the dialog never shows and the permission.status always returns “denied”.

Have checked app permissions in android system settings and is empty.

1 Like

Hey @ijaas,

Can you share the contents of your app.json here?

Cheers,
Adam

{
    "expo": {
        "name": "HUDDLE",
        "slug": "huddle",
        "version": "1.2.7",
        "sdkVersion": "32.0.0",
        "androidStatusBar": {
            "barStyle": "dark-content",
            "backgroundColor": "#ff4600"
        },
        "privacy": "unlisted",
        "scheme": "huddle",
        "icon": "./icon.png",
        "ios": {
            "bundleIdentifier": "com.airupthere.huddle",
            "infoPlist": {
                "NSCameraUsageDescription": "Add a photo to your HUDDLE profile."
            }
        },
        "android": {
            "package": "com.airupthere.huddle",
            "googleServicesFile": "./google-services-prod.json",
            "versionCode": 127,
            "permissions": []
        },
        "updates": {
            "enabled": true
        },
        "hooks": {
            "postPublish": [
                {
                    "file": "sentry-expo/upload-sourcemaps",
                    "config": {
                        "organization": "dex-labs",
                        "project": "huddle-app",
                        "authToken": "*******"
                    }
                }
            ]
        },
        "assetBundlePatterns": [
            "src/assets/*"
        ],
        "splash": {
            "image": "./src/assets/img/splash.png",
            "backgroundColor": "#fff",
            "resizeMode": "contain"
        }
    }
}

@adamjnav

Ok i realized my mistake and added the permissions array to app.json.

Calendar works fine not but seem to be getting “denied” for Camera_Roll.

Code Sample:

            permissionCamera = await Permissions.askAsync( Permissions.CAMERA );

                if ( permissionCamera.status == 'granted' ) {

                    permissionCameraRoll = await Permissions.askAsync( Permissions.CAMERA_ROLL );

                    if ( permissionCameraRoll.status == "granted" ) {

                        let image = await ImagePicker.launchCameraAsync( {
                            mediaTypes: "Images",
                            allowsEditing: true,
                            aspect: aspectRatio,
                            quality: .8,
                        } );

                        _this.onImageSelected( image, category, saveTo );

                    } else {

                        this.permissionFailed( "permissionCameraRoll", permissionCameraRoll.status );

                    }

                } else {

                    this.permissionFailed( "permissionCamera", permissionCamera.status );

                }

            },

Permissions Array:

            "permissions": [
                "CAMERA",
                "READ_EXTERNAL_STORAGE",
                "WRITE_EXTERNAL_STORAGE",
                "READ_CALENDAR",
                "WRITE_CALENDAR"
            ]

Resolved by uninstalling and reinstalling from latest build.

Am assuming changes to app.json do not reflect when the app is updated using OTA js bundle.

In case anyone has the same issue in the future.

The steps to fix would be:

  1. make sure app.json has permissions included for android as per https://docs.expo.io/versions/latest/sdk/permissions/
  2. make sure app is updated via play store or latest .apk bundle and not only via ota update.

that should resolve the always denied permissions issue.

Topic can be closed.

Glad you got to the bottom of all this, @ijaas! You are correct regarding the app.json changes not being able to updated OTA. You can read more about publishing limitations here.

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