Error when linking
theduckchannel opened this issue · comments
Hi,
I was trying link vasern in my app and get the following error:
PS C:\Users\fredc\Documents\Projetos\questoespython3> npx react-native link vasern
warn Calling react-native link [packageName] is deprecated in favor of autolinking. It will be removed in the next major release.
Autolinking documentation: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Linking "vasern" iOS dependency
info iOS module "vasern" has been successfully linked
info Linking "vasern" Android dependency
error Linking "vasern" failed. Run CLI with --verbose flag for more details.
Error: ENOENT: no such file or directory, open 'C:\Users\fredc\Documents\Projetos\questoespython3\android\app\src\main\java\com\questoespython3\MainApplication.java'
at Object.openSync (fs.js:458:3)
at Object.readFileSync (fs.js:360:35)
at applyPatch (C:\Users\fredc\Documents\Projetos\questoespython3\node_modules\@react-native-community\cli-platform-android\build\link\patches\applyPatch.js:42:51)
at Object.registerNativeAndroidModule [as register] (C:\Users\fredc\Documents\Projetos\questoespython3\node_modules\@react-native-community\cli-platform-android\build\link\registerNativeModule.js:34:27)
at C:\Users\fredc\Documents\Projetos\questoespython3\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\link\linkDependency.js:63:16
at Array.forEach (<anonymous>)
at linkDependency (C:\Users\fredc\Documents\Projetos\questoespython3\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\link\linkDependency.js:36:32)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Object.link [as func] (C:\Users\fredc\Documents\Projetos\questoespython3\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\link\link.js:110:5)
at async Command.handleAction (C:\Users\fredc\Documents\Projetos\questoespython3\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
Welcome @fredcox! It seems to me that the error wasn't caused by vasern but
Error: ENOENT: no such file or directory, open 'C:\Users\fredc\Documents\Projetos\questoespython3\android\app\src\main\java\com\questoespython3\MainApplication.java'
at Object.openSync (fs.js:458:3)
Have you try to fix as these thread? Stackoverflow - Can't find my MainApplication.java
Solved it by below mentioned steps:
- deleted the project dir
- cloned the project
- npm i
- react-native link
All right