CodetrixStudio / CapacitorGoogleAuth

Capacitor plugin for Google Auth. Lightweight & no dependencies.
MIT License
282 stars 155 forks source link

Android app crashes on launch #294

Closed OnlinePage closed 1 year ago

OnlinePage commented 1 year ago

Hi I am trying to use latest version 3.3.2 with npm i --save @codetrix-studio/capacitor-google-auth and then

npx cap update

when app is now build with ionic cap sync and launched on device via android studio: IT CRASHES!! 😲 and doestn launch. Can't even see debug log when launched with debugger attached😔.

What could posssible go wrong🤔?

I am using capacitor 5 " "@capacitor/android": "5.2.1", "@capacitor/app": "^5.0.6", "@capacitor/browser": "^5.0.6", "@capacitor/clipboard": "^5.0.6", "@capacitor/core": "^5.2.1",

Okay when debugging I found below error trace:

` Caused by: java.lang.NegativeArraySizeException: -1 at com.codetrixstudio.capacitor.GoogleAuth.GoogleAuth.load(GoogleAuth.java:71) at com.getcapacitor.PluginHandle.loadInstance(PluginHandle.java:115) at com.getcapacitor.PluginHandle.load(PluginHandle.java:105)

`

OnlinePage commented 1 year ago

@Monomachus please look to above issue

OnlinePage commented 1 year ago

Alright the issue was the options were not properly set in the capacitor.config.js But still now everytime login response is error code 10 Please respond it , it totall urgent!!

Martin-Eckleben commented 11 months ago

Alright the issue was the options were not properly set in the capacitor.config.js But still now everytime login response is error code 10 Please respond it , it totall urgent!!

How did you set them properly? I'm there now as well.

Mine:

import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  appId: <id>,
  appName: <name>,
  webDir: 'www',
  bundledWebRuntime: false,

  plugins: {
    GoogleAuth: {
      clientId: '<clientID>.apps.googleusercontent.com'
    },
  },
}

export default config
Martin-Eckleben commented 11 months ago

I solved it with

  plugins: {

    GoogleAuth: {
      scopes: ["profile", "email"],
      clientId: '<clientID>.apps.googleusercontent.com',
    },
  },

Then I did not even have to state it in the initialize call anymore (as it was described in the Readme.md): GoogleAuth.initialize();