moberwasserlechner / capacitor-filesharer

Capacitor plugin to download and share files for the Web, Android and iOS! Stop the war in Ukraine!
MIT License
82 stars 20 forks source link

package com.byteowls.capacitor.filesharer.FileSharerPlugin does not exist #27

Closed rohantejeswar closed 3 years ago

rohantejeswar commented 3 years ago

Capacitor version:

Latest Dependencies:

  @capacitor/cli: 2.4.5
  @capacitor/core: 2.4.5
  @capacitor/android: 2.4.5
  @capacitor/electron: 2.4.5
  @capacitor/ios: 2.4.5

Installed Dependencies:

  @capacitor/ios not installed
  @capacitor/cli 2.4.2
  @capacitor/core 2.4.2
  @capacitor/android 2.4.4
  @capacitor/electron not installed

Affected Platform(s):

Current Behavior

On trying to register plugin in Android at com.companyname.appname.MainActivity#onCreate, importing the plugin says that the plugin is not found

Expected Behavior

I would expect the plugin to register in MainActivity

Sample Code or Sample Application Repo

...
import com.byteowls.capacitor.filesharer.FileSharerPlugin;

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(FileSharerPlugin.class);
    }});
  }
}

Other Information

I do not have any expirence with Android Studio, any help with getting this plugin to work would be appreciated

moberwasserlechner commented 3 years ago

Hey,

can you check if you have done these steps: 1) Install the plugin npm i ... 2) npx cap sync android 3) Open Android studio 4) If the Plugin is still not found. Find the Gradle section. Right click on the first entry and "Reimport Gradle Project" grafik

See the Capacitor Android Docs for further information.

rohantejeswar commented 3 years ago

Hey!

Thanks a ton for your help. Turns out all I needed to do was npx cap sync android.