Closed ZhymonNorman closed 2 years ago
This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue.
Please see the Contributing Guide for how to create a Code Reproduction.
Thanks! Ionitron π
Im having same issue here, but with custom plugin (following custom plugin creation tutorial).
Ive tried:
My MainActivity.java is =
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
registerPlugin(com.hmsolutions.cashregisterplugin.CashRegisterPlugin.class);
}
}
π Capacitor Doctor π
Latest Dependencies:
@capacitor/cli: 3.0.2
@capacitor/core: 3.0.2
@capacitor/android: 3.0.2
@capacitor/ios: 3.0.2
Installed Dependencies:
@capacitor/ios: not installed
@capacitor/cli: 3.0.2
@capacitor/android: 3.0.2
@capacitor/core: 3.0.2
Thanks for helping, this is my first post on github.
@jcesarmobile just checking for clarification was my code reproduction insufficient?
yes
@jcesarmobile updated
We need a real app where the issue can be reproduced, check the link ionitron provided about how to create one https://github.com/ionic-team/capacitor/blob/HEAD/CONTRIBUTING.md#creating-a-code-reproduction
@jcesarmobile
https://github.com/ZhymonNorman/capactiorjs_bugreport_4791 Froked from https://github.com/mlynch/nextjs-tailwind-ionic-capacitor-starter
package.json
{
"name": "nextjs-tailwind-capacitor",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"sync": "next build && next export && yarn run cap sync",
"build": "next build",
"start": "next start",
"export": "next export"
},
"dependencies": {
"@capacitor/android": "3.0.2",
"@capacitor/cli": "^3.0.2",
"@capacitor/core": "^3.0.2",
"@capacitor/ios": "^3.0.2",
"@ionic/react": "^5.6.11",
"@ionic/react-router": "^5.6.11",
"autoprefixer": "^10.2.6",
"@capacitor/browser": "1.0.2",
"classnames": "^2.3.1",
"next": "11.0.1",
"postcss": "^8.3.5",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-router-dom": "^5.2.0",
"react-virtuoso": "^1.9.3",
"tailwindcss": "^2.2.4"
},
"devDependencies": {
"ionicons": "^5.5.2",
"prettier": "^2.3.2",
"pullstate": "^1.22.1",
"react-use-gesture": "^9.1.3",
"reselect": "^4.0.0"
}
}
/components/pages/Settings.jsx
import {
IonPage,
IonHeader,
IonItem,
IonToolbar,
IonTitle,
IonContent,
IonList,
IonToggle,
IonLabel,
IonButton,
} from '@ionic/react';
import { Browser } from "@capacitor/browser";
import Store from '../../store';
import * as selectors from '../../store/selectors';
import { setSettings } from '../../store/actions';
async function openCapacitorSite(uri) { await Browser.open({ url: uri }); }
const Settings = () => { const settings = Store.useState(selectors.getSettings);
return (
); };
export default Settings;
- build and run app via Android Studio
- tap the menu button (top left)
- tap "Settings" button
- Tap the 'URL Test' button (right hand side)
the sample app you have provided has the init method in MainActivity.java
// Initializes the Bridge
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
}});
Which prevents automatic plugin loading, if you remove it as explained on the upgrade guide then it works
Or you can continue using the manual registration by adding add(BrowserPlugin.class);
inside the init method
Issue appears to be unrelated to plugin registration, thank you for your help.
What the hell is going on with this new version of Capacitor? When I started my adventure with the second version, everything went smoothly and beautifully. Plugins cannot be used in the new version! I create a new project and follow the instructions, and the plugins throw errors.
import { LocalNotifications } from '@capacitor/local-notifications'
export default {
name: 'Settings',
methods: {
async getNotification () {
await LocalNotifications.requestPermission() // localNotifications.requestPermissions is not implemnted on android
await LocalNotifications.schedule({
notifications: [
{
title: 'Title',
body: 'Body',
id: new Date().getTime(),
schedule: { at: new Date(Date.now() + 1000 * 5) },
sound: null,
attachments: null,
actionTypeId: '',
extra: null
}
]
})
}
}
}
Also i've got similar error in Device plugin.
Still havenβt resolved this on my end either.
I'm still getting the error plugin is not implemented on android
. I have followed all the advice but I am still getting the error
My MainActivity.java looks like this
package com.ionicframework.chalk208279;
import android.os.Bundle;
import com.getcapacitor.BridgeActivity;
import com.hemangkumar.capacitorgooglemaps.CapacitorGoogleMaps;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
registerPlugin(com.getcapacitor.community.facebooklogin.FacebookLogin.class);
registerPlugin(CapacitorGoogleMaps.class);
}
}
It looks like MainActivity.java is completly being ignored.
Latest Dependencies:
@capacitor/cli: 3.1.2
@capacitor/core: 3.1.2
@capacitor/android: 3.1.2
@capacitor/ios: 3.1.2
Installed Dependencies:
@capacitor/cli: 3.1.2
@capacitor/core: 3.1.2
@capacitor/android: 3.1.2
@capacitor/ios: 3.1.2
[success] iOS looking great! π
[success] Android looking great! π
In the provided app the problem was the automatic registration not enabled, so please, don't reopen the issue. If you still face the issue after enabling the automatic registration, create a new issue with a new sample app where the automatic registration is enabled but the plugins don't work.
Bug Report
Capacitor Version
Platform(s)
Android
Current Behavior
Hi everyone, looking for some assistance with capacitor v3 and plugins for Android, on iOS all the plugins we want to use are working just fine, however with Android I keep getting Msg: Uncaught (in promise) Error: plugin is not implemented on android below is the package json, MainActivity.java and capacitor config. thank you.
MainActivity.java
Package.json (plugins only, can provide full file if needed)
capacitor config
logs
Expected Behavior
Any core capacitor plugin should be auto registered and work out of the box.
Code Reproduction
npx cap sync
Other Technical Details
node version v14.15.4
nextjs ^10
vianext export
typescript
react js