Hi everyone! I’m having a problem with capacitor 4:
Uncaught (in promise) Error: “Share” plugin is not implemented on android
that’s my MainActivity:
import android.os.Bundle;
import android.provider.ContactsContract;
import androidx.annotation.Nullable;
import com.getcapacitor.BridgeActivity;
import com.getcapacitor.Plugin;
import com.getcapacitor.plugin.Filesystem;
import com.getcapacitor.plugin.Share;
import com.getcapacitor.plugin.Storage;
//import com.byteowls.capacitor.filesharer.FileSharerPlugin;
import java.util.ArrayList;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
registerPlugin(Share.class);
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(Filesystem.class);
add(Share.class);
// add(FileSharerPlugin.class);
}});
}
private void registerPlugin(Class shareClass) {
}
/* @Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
System.out.println(“stampo array plugins”);
System.out.println(savedInstanceState.size());
} */
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.clear();
}
}
How can I fix that?
Thank you