React Native not found linked packages

Issue

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]

Solution

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. 😄

Answered By – assisrMatheus

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published