7

I have an app which fails on linking/unlinking packages, similar to this issue.

It specifically fails on linking the MainApplication.java file with this error.

error Something went wrong while unlinking. Reason ENOENT: no such file or directory, open './AppName/android/app/src/main/java/co/AppName/AppName/MainApplication.java'

The path is actually incorrect java/co/AppNAme should be java/com/AppName.

I can't find anywhere what could be causing this or any documentation on how to set the path.

I've tried using babel-plugin-module-resolver but no success, unless im missing something. Anyone had a similar problem?

Mark
  • 2,061
  • 1
  • 16
  • 26

2 Answers2

2

TLDR: Adding another folder like so java/co/AppNAme/AppName/ will fix your issue.

After updating to the latest react-native I had this issue too. Your android path contains your apps ID so com.test.app path should be android/app/src/main/java/com/test/app.

You've stated;

The path is actually incorrect java/co/AppNAme should be java/com/AppName.

This isn't correct as looking at your error message, its actually telling you where its expecting the file to be;

no such file or directory, open java/co/AppName/AppName/MainApplication.java

If you create another folder like so java/co/AppNAme/AppName/ it will fix your issue.

Hyper
  • 426
  • 1
  • 4
  • 7
  • Yeah, that was it, I didn't realize that the app ID and path was connected. Thanks! Welcome to SO. – Mark Nov 09 '19 at 17:24
0

Try renaming your project and then see whether after renaming the project the path is correct or not.

You may also try giving manual path or add the folder where it searches by default let's say com.company.name

Rishav Kumar
  • 4,979
  • 1
  • 17
  • 32