-
Notifications
You must be signed in to change notification settings - Fork 161
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
I get this error: Error: "GoogleAuth" plugin is not implemented on android #116
Comments
I have the same problem! Please help! |
same |
Okay, I resolved this issue |
yes, you should remove the import of the Google Auth plugin of the MainActivity.java https://capacitorjs.com/docs/updating/3-0#switch-to-automatic-android-plugin-loading this means you can comment out / remove the import com.codetrix..... and also the code inside the BridgeActivity Make sure that you have installed "@capacitor/cli": "^3.0.1" in the dev dependencies When you run npx cap sync android, you will see that capacitor now installs all the plugins automatically |
I followed all the steps for update from capacitor 2 to 3, but I get the same problem. "GoogleAuth.init()" is not implemented on android. |
Yeah, I am having the same problem, and if I remove the init(), it keeps stuck in google form... |
"GoogleAuth.init()" is only for WEB (https://github.com/CodetrixStudio/CapacitorGoogleAuth#migrate-from-2-to-3). For Android and iOS is not necessary. I added a condition for checking that: import { Device, DeviceInfo } from "@capacitor/device";
import { GoogleAuth } from "@codetrix-studio/capacitor-google-auth";
...
const onSignInGoogle = async () => {
try {
const deviceInfo = await Device.getInfo();
if ((deviceInfo as unknown as DeviceInfo).platform === "web") {
await GoogleAuth.init();
}
const googleUser = (await GoogleAuth.signIn());
... For the original issue, it worked as commented here: #110 |
@FabioGoncalves, what are the logs on the Android Studio or Chrome device Dev tools? |
After doing that I'm getting the error: |
Follow the guide for upgrading Capacitor. It will solve that. https://capacitorjs.com/docs/updating/3-0 Comment or remove the
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
// add(Plugin1.class);
// add(Plugin2.class);
// }});
// }
} But for using the GoogleAuth, you need to register it like that: import android.os.Bundle;
import com.getcapacitor.BridgeActivity;
import com.codetrixstudio.capacitor.GoogleAuth.GoogleAuth;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
registerPlugin(GoogleAuth.class);
}
} https://capacitorjs.com/docs/updating/3-0#switch-to-automatic-android-plugin-loading |
I followed all the steps but I get an error "c.NativePromise is not a function". Please help find solution to this issue and if possible those who have it work can share their knowledge on the steps and possibly share an example github repo to reference. Thanks in advance |
Give more info about what you are trying to achieve. Where and when does this error happen? |
I'm using Ionic Capacitor 3 for my app and I need to authenticate user with Google SignIn. At first, I was using the GooglePlus capacitor plugin which wasn't working but later found out that the CodetrixStudio/CapacitorGoogleAuth was best to integrate. I used that in my project which worked on iOS without any error but fails on Android with error "c.NativePromise is not a function" which happens to log an error "window.Capacitor.triggerEvent is not a function" |
I don't know. The best I found was that about dev environment using https, but working with http. |
@DercilioFontes This works on Chrome, but on android was not working: this was like, 4 days ago. |
@FabioGoncalves can you please help me solve it? |
Do you have capacitor 3? Btw, I answered here #109 |
I'm also facing the issue, did everything, it works fine for the Web app and neither does for the Android app. I guess it happens because of the "Authorized JavaScript origins", as it does not allow to set the IP address. |
@FabioGoncalves Yes, I'm using Capacitor 3, I have configured everything too. @emtiajium were you able to make it work? |
I added the key in the XML file that is generated by the Firebase ( So, web app is working and Android app is not |
You have to use the same Web client key!! |
Tried with the web client key at the I couldn't figure it out! |
Finally I solved it 🥳🥳🥳 |
Yeah, I was in the same situation, but after 2-3 days when I went check again, it was working... xD |
I did not get CodetrixStudio/CapacitorGoogleAuth to work in my project . Instead, I had to change to Ionic Google Plus https://ionicframework.com/docs/native/google-plus. I followed all the instructions and its worked in my Angular-Ionic project. I am using capacitor. Summarizing it. Install the needed packages and sync it.
Inside app.module import GooglePlus In you login page, insert:
See https://github.com/EddyVerbruggen/cordova-plugin-googleplus#usage for replace empty object inside googlePlus.login() Create credentials in Console google https://console.cloud.google.com/ Once you had create the credentials and you had setup your project, run the project on android emulator or physical device and test it. |
Well I have it working on android now with CodetrixStudio/CapacitorGoogleAuth 🥳✌🏽 |
What have you done? Just waited? 😅 |
@FabioGoncalves I tested it on an emulator and it worked! |
@codemickey78 nice! I am glad you could make it! |
@FabioGoncalves my app is live now on AppStore & PlayStore |
How to fix the error :"Error: "GoogleAuth" plugin is not implemented on android" |
@brightchip, have you done that? |
I kept the Main Activity default as It says "Cannot resolve symbol 'codetrixstudio'" |
@brightchip, have you updated to Capacitor 3 and capacitor-google-auth 3?
|
Yes I just installed it recently |
Oh wait. Thanks a lot! It got fixed I just have to run |
@LuisMSotamba Thank you for your solution. It is much easier than with CodetrixStudio/CapacitorGoogleAuth |
I'm using ionic with capacitor for my project and in my case the gmail sign in worked with in following cases:
But - when I put it in the play store and install it on real device for internal test, the sign it not working. I can choose the gmail account for the sign it, but after I clicked on this account it just return to my page without continue to complete the sign in. |
It took me a lot of time to fix this issue, so I will summarize here what works for me, to save time to other good people. I also used the information from this page especially from @FabioGoncalves and @DercilioFontes - thanks!
index.html strings.xml login page |
Reload gradle project in android studio |
Underrated comment for newbies like myself |
I have this same problem, but with version 5 |
Guys do not forget adding this to your capacitor config: |
The issue with mine was that the package.json wasn't updating properly as I was installing the dependencies. So, it's a monorepo with a general dependency, and then ionic kinda generates its package.json and the dependencies' plugin wasn't updating there |
I'm going crazy, I can't find a way to fix it. Does anyone know how to do it?
The text was updated successfully, but these errors were encountered: