react-native-spinkit icon indicating copy to clipboard operation
react-native-spinkit copied to clipboard

Use of package name in rnpm-prelink.sh

Open crisu83 opened this issue 9 years ago • 0 comments

I encountered the following issue when linking the module for Android in my current project:

react-native link react-native-spinkit
RNSpinkit checking app version ..
RNSpinkit patching MainApplication.java ..

<PROJECT_PATH>/node_modules/react-native-spinkit/scripts/rnpm-prelink.js:71
    throw 'RNSpinkit could not link Android automatically, MainApplication.java not found in path : ' + APPLICATION_MAIN
    ^
RNSpinkit could not link Android automatically, MainApplication.java not found in path : <PROJECT_PATH>/android/app/src/main/java/com/<PACKAGE_NAME>/MainApplication.java
<PROJECT_PATH>/node_modules/react-native/local-cli/core/makeCommand.js:19
        throw new Error(`Error occured during executing "${ command }" command`);
        ^

Error: Error occured during executing "node ./node_modules/react-native-spinkit/scripts/rnpm-prelink.js" command
    at ChildProcess.prelink (<PROJECT_PATH>/node_modules/react-native/local-cli/core/makeCommand.js:19:15)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)

It turns out that the problem was that the script assumes that your project name is the same as the package name, which wasn't the case in my project (the package name had a suffix, -mobile) in the package name to avoid package naming collisions.

crisu83 avatar Oct 27 '16 08:10 crisu83