Diego Charles
Diego Charles

Reputation: 113

React Native with Expo fails on Android Emulator - Couldn't find implementation for Permissions Interface

I'm trying to run one react-native app on the Android Emulator but the app shows this error after it launches.

Couldn't find implementation for Permissions Interface

It's not clear for me if it's complaining about the Android's Permission or if it comes from expo-permissions declared as dependency from other expo libs like expo-av and expo-image-picker.

Would you help me please?

Here's the build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 24
        compileSdkVersion = 30
        targetSdkVersion = 30
        // androidXAnnotation = "1.1.0"
        // androidXBrowser = "1.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        classpath 'com.google.gms:google-services:4.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven { url 'https://maven.google.com' }
        maven { url 'https://www.jitpack.io' }
        maven {
            // expo-camera bundles a custom com.google.android:cameraview
            url "$rootDir/../node_modules/expo-camera/android/maven"
        }
        google()
        jcenter()
    }
}

and here's the dependencies:

{
  "name": "Instadating",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "react-native start",
    "prettier": "prettier --write '*.js' 'src/**/*.js'",
    "android": " cd android && ./gradlew clean && cd .. && react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint src/.",
    "fixlint": "eslint --fix src/.; exit 0",
    "test": "jest"
  },
  "dependencies": {
    "@invertase/react-native-apple-authentication": "^1.1.1",
    "@react-native-community/art": "^1.2.0",
    "@react-native-community/async-storage": "^1.6.3",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-firebase/app": "^11.2.0",
    "@react-native-firebase/auth": "^11.2.0",
    "@react-native-firebase/messaging": "^11.2.0",
    "@react-navigation/bottom-tabs": "^5.7.0",
    "@react-navigation/compat": "^5.2.0",
    "@react-navigation/drawer": "^5.8.5",
    "@react-navigation/native": "^5.7.0",
    "@react-navigation/stack": "^5.7.0",
    "@reduxjs/toolkit": "^1.0.4",
    "axios": "^0.19.0",
    "base-64": "^0.1.0",
    "crypto-js": "^3.1.9-1",
    "expo-av": "^9.0.0",
    "expo-blur": "^9.0.0",
    "expo-camera": "^10.0.0",
    "expo-constants": "^10.0.1",
    "expo-facebook": "^10.0.0",
    "expo-file-system": "^10.0.0",
    "expo-firebase-recaptcha": "^1.3.0",
    "expo-image-picker": "^10.0.0",
    "expo-localization": "^10.0.0",
    "expo-location": "^11.0.0",
    "firebase": "8.3.2",
    "i18n-js": "^3.5.0",
    "invert-color": "^2.0.0",
    "lodash": "^4.17.21",
    "lodash.isequal": "^4.5.0",
    "lodash.memoize": "^4.1.2",
    "moment": "^2.27.0",
    "oauth-1.0a": "^2.2.6",
    "react": "17.0.1",
    "react-native": "0.64.0",
    "react-native-actionsheet": "^2.4.2",
    "react-native-app-intro-slider": "^4.0.4",
    "react-native-appearance": "^0.3.4",
    "react-native-autogrow-textinput": "^5.4.0",
    "react-native-button": "^3.0.1",
    "react-native-confirmation-code-field": "^6.5.0",
    "react-native-create-thumbnail": "^1.2.2",
    "react-native-deck-swiper": "^2.0.5",
    "react-native-dialog-input": "^1.0.8",
    "react-native-elements": "^2.3.1",
    "react-native-fast-image": "^8.3.2",
    "react-native-ffmpeg": "^0.5.0",
    "react-native-gesture-handler": "^1.7.0",
    "react-native-get-random-values": "^1.4.0",
    "react-native-iap": "^6.0.2",
    "react-native-image-crop-picker": "^0.33.2",
    "react-native-image-picker": "^2.3.3",
    "react-native-image-progress": "^1.1.1",
    "react-native-image-resizer": "^1.2.6",
    "react-native-image-view": "^2.1.9",
    "react-native-indicators": "^0.17.0",
    "react-native-iphone-x-helper": "^1.2.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.2",
    "react-native-keyboard-aware-view": "^0.0.14",
    "react-native-keyboard-tracking-view": "^5.7.0",
    "react-native-localize": "^1.3.1",
    "react-native-modal": "^11.4.0",
    "react-native-modal-patch": "https://github.com/HarvestProfit/react-native-modal-patch.git",
    "react-native-modalbox": "^2.0.0",
    "react-native-phone-input": "^0.2.4",
    "react-native-progress": "^4.1.2",
    "react-native-reanimated": "^1.13.0",
    "react-native-safe-area-context": "^3.1.7",
    "react-native-screens": "^2.10.1",
    "react-native-scrollable-tab-view": "^0.10.0",
    "react-native-search-bar": "^3.5.1",
    "react-native-search-box": "^0.0.19",
    "react-native-slider": "^0.11.0",
    "react-native-splash-screen": "^3.2.0",
    "react-native-swiper": "^1.6.0",
    "react-native-ui-lib": "^5.19.0",
    "react-native-unimodules": "^0.11.0",
    "react-native-vector-icons": "^7.0.0",
    "react-native-video": "^5.1.0-alpha8",
    "react-native-view-overflow": "^0.0.5",
    "react-native-webview": "^10.8.3",
    "react-redux": "^7.1.1",
    "redux": "^4.0.4",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "remote-redux-devtools": "^0.5.16",
    "uuidv4": "^5.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "babel-eslint": "^10.0.3",
    "babel-jest": "^25.1.0",
    "eslint": "^4.3.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-config-idiomatic": "^4.0.0",
    "eslint-config-prettier": "^4.3.0",
    "eslint-plugin-import": "^2.17.3",
    "eslint-plugin-jsx-a11y": "^6.2.1",
    "eslint-plugin-prettier": "^3.1.0",
    "eslint-plugin-react": "^7.13.0",
    "eslint-plugin-react-native": "^3.7.0",
    "jest": "^25.1.0",
    "jetifier": "^1.6.6",
    "metro-react-native-babel-preset": "^0.59.0",
    "prettier": "2.0.4",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

Thanks in Advance :)

Upvotes: 1

Views: 2353

Answers (3)

Nathan W
Nathan W

Reputation: 51

I have similar problem. I think you missed "expo install" (to link the expo and run module) the project before running it.

you could try: npm install -> expo install -> npx react-native run-android.

If it still doesn't work, you may try npm start -- --reset-cache to clean the cache for run and run it.

Upvotes: 1

Yvo
Yvo

Reputation: 19263

This is very likely caused by the version of expo-permissions that you're using. I ran into this issue after I ran npm-check-updates and it updated expo-permissions and expo-image-picker.

When I dropped back to these two versions (left column), everything worked well again:

 expo-image-picker        ^10.1.4  →  ^10.2.2     
 expo-permissions         ^12.0.1  →  ^12.1.1

Upvotes: 0

Emetrop
Emetrop

Reputation: 322

I had same problem after I installed expo-image-picker with version 10.*, downgrade to version 9.* helped me to fix it.

You'll have to update even your build.gradle to

buildscript {
ext {
    buildToolsVersion = "29.0.3"
    minSdkVersion = 21
    compileSdkVersion = 29
    targetSdkVersion = 29
}
...

Upvotes: 0

Related Questions