Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] file ios/App/public/cordova.js does not exist #24

Closed
michaeltintiuc opened this issue Feb 22, 2019 · 8 comments
Closed

[iOS] file ios/App/public/cordova.js does not exist #24

michaeltintiuc opened this issue Feb 22, 2019 · 8 comments
Labels
question Support

Comments

@michaeltintiuc
Copy link

Installing the plugin and running npx cap update works well for all platforms except iOS:

✖ update ios: ENOENT: no such file or directory, open 'ios/App/public/cordova.js'
[error] Error running update: { [Error: ENOENT: no such file or directory, open 'ios/App/public/cordova.js']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'ios/App/public/cordova.js' }
@moberwasserlechner
Copy link
Collaborator

As this plugin does not use cordova at all, your issue is most propably no bug I can do anything about.

Anyway here are some tips:

  • clean your project
  • try to restart your IDE
  • clear your caches
  • delete your node_modules directory
  • XCode 10+. It is most important to always clean the build because XCode caches are not updating by there own.

@michaeltintiuc
Copy link
Author

I am not using any cordova plugins, as I've mentioned in the description, I have just installed the plugin and ran cap update, the error was thrown within the console, not my IDE. Besides this was done on a Linux machine. I have noticed that some of the minor details in readme are out of date with the latest capacitor beta versions, perhaps it could be related? I am using beta.13

@moberwasserlechner
Copy link
Collaborator

moberwasserlechner commented Feb 22, 2019

I only gave you some tips on how to catch your problem.

I am not using any cordova plugins, as I've mentioned in the description

The description does not say anything about you not using cordova. You just posted an error.

I have noticed that some of the minor details in readme are out of date with the latest capacitor

Please let me know, which ones you mean so I can fix it.

I am using beta.13

The plugin beta.1 needs capacitor beta.17. npm install should have informed you about that.

@michaeltintiuc
Copy link
Author

I see, will give it a go with an updated version, thanks for the quick replies! 👍

@michaeltintiuc
Copy link
Author

In terms of README, I've found that the capacitor docs are suggesting this:

// Other imports...
import com.example.myapp.EchoPlugin;

public class MainActivity extends BridgeActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Initializes the Bridge
    this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
      // Additional plugins you've installed go here
      // Ex: add(TotallyAwesomePlugin.class);
      add(EchoPlugin.class);
    }});
  }
}

while plugin readme suggests:

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        List<Class<? extends Plugin>> additionalPlugins = new ArrayList<>();
        // Additional plugins you've installed go here
        // Ex: additionalPlugins.add(TotallyAwesomePlugin.class);
        additionalPlugins.add(OAuth2ClientPlugin.class);

        // Initializes the Bridge
        this.init(savedInstanceState, additionalPlugins);
    }

@moberwasserlechner
Copy link
Collaborator

Ah ;) I have lots of experience in Java and doing it the Capacitor way is most uncommon in the Java world.

So I used my actual code for the description as I think it's easier to read. But's your call what you want to use basically it's the same.

Further more this whole think should not be needed as soon as ionic-team/capacitor#952 is implemented. Android plugins should be discovered automatically as they are on iOS.

@michaeltintiuc
Copy link
Author

Awesome, thanks for your work!

@moberwasserlechner
Copy link
Collaborator

I close this for now. I the problem persist with capacitor beta.17 I'll reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Support
Projects
None yet
Development

No branches or pull requests

2 participants