João Baraky
João Baraky

Reputation: 715

React Native not found linked packages

When trying to run the react-native run-android, the build is not able to find the linked packages.

Already tried to update the packages, everything is on the newest version.

package.json:

"@react-native-community/async-storage": "1.5.0",
"@react-native-community/netinfo": "3.2.1",
"lodash": "4.17.11",
"react": "16.8.6",
"react-native": "0.59.10",
"react-native-actionsheet": "2.4.2",
"react-native-device-info": "2.1.3",
"react-native-gesture-handler": "1.3.0",
"react-native-image-crop-picker": "0.24.1",
"react-native-masked-text": "1.12.3",
"react-native-progress-bar-animated": "1.0.6",
"react-native-youtube": "1.1.0",
"react-navigation": "3.11.0",
"react-redux": "7.1.0",
"redux": "4.0.1",
"redux-persist": "5.10.0",
"redux-saga": "1.0.4"

On CLI: package com.facebook.react.module.annotations does not exist: import com.facebook.react.module.annotations.ReactModule

On Android Studio: Not a supported repository protocol 'C': valid protocols are [file, http, https, gcs, s3, sftp]

Upvotes: 2

Views: 2067

Answers (1)

assisrMatheus
assisrMatheus

Reputation: 475

This usually happens when your build is not able to find your node_modules folder.

Try to check on your android/build.gradle file, if there's any fixed path, for example:

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "C:/dev/myapp/node_modules/react-native/android"
        }
        maven { url "https://jitpack.io" }
    }
}

Take a look in the line url "C:/dev/myapp/node_modules/react-native/android".

You may want to change the fixed path to its relative version: url "$rootDir/../node_modules/react-native/android"

This should help the build find the correct path. 😄

Upvotes: 2

Related Questions