capacitor-community / facebook-login

Facebook Login support
MIT License
102 stars 57 forks source link

[v3] Path to module in gradle.xml incorrectly set when working in monorepo #43

Closed alexciesielski closed 3 years ago

alexciesielski commented 3 years ago

Describe the bug I have installed the plugin according to v3's readme in our Ionic+Angular monorepo and have the following error when building my app:

error: package com.getcapacitor.community.facebooklogin does not exist registerPlugin(com.getcapacitor.community.facebooklogin.FacebookLogin.class);

when running the app in Android Studio.

Upon further inspection I see that in projects/app/android/.idea/gradle.xml the path to the facebook-login module is incorrect:

<option name="modules">
  <set>
        <option value="$PROJECT_DIR$/../../../node_modules/@capacitor/android/capacitor" />
        <option value="$PROJECT_DIR$" />
        <option value="$PROJECT_DIR$/app" />
        <option value="$PROJECT_DIR$/capacitor-cordova-android-plugins" />
        <option value="$PROJECT_DIR$/../node_modules/@capacitor-community/facebook-login/android" />
  </set>
</option>

The project lies at /projects/app and therefore the import should point two folders higher. I have tried editing the file directly but it gets rebuilt anyway and it didn't help.

Is this a plugin bug or some misconfiguration? Thanks!

Desktop (please complete the following information):

"@capacitor-community/facebook-login": "^3.0.0-3",
"@capacitor/android": "^3.0.0-rc.0",
Yuripetusko commented 3 years ago

Set this in your root level package.json and project specific package.json then delete node_modules and do yarn install from root of monorepo

"workspaces": {
    "nohoist": [
      "@capacitor",
      "@capacitor/*",
      "@capacitor-community/*",
    ]
  },
rdlabo commented 3 years ago

Thanks for test. This is not plugin issue, maybe @capacitor/ios issue.