Java error on load
Occasionally we receive the error java.lang.NegativeArraySizeException on GoogleAuth.load (GoogleAuth.java:45)
This causes the login button to not work. Is there any particular reason this happens?
My issue seemed to be with https://github.com/capacitor-community/facebook-login conflicting with CapacitorGoogleAuth, I setup a new project and did the setup for CapacitorGoogleAuth first and then added Facebook auth after. That seemed to do the trick for me.
Annoying issue, I wish you luck!
Coming back as I have more info for you. This error, for me, came from the scopes array not having any values in it, or the plugin wasn't fetching the right capacitor.config version. I'd suggest going into the java code for the plugin and doing some logging.
In the CapConfig.java file I added this log:
public PluginConfig getPluginConfiguration(String pluginId) {
PluginConfig pluginConfig = pluginsConfiguration.get(pluginId);
Log.d("pluginConfig", pluginConfig.getConfigJSON().toString());
if (pluginConfig == null) {
pluginConfig = new PluginConfig(new JSONObject());
}
return pluginConfig;
}
to ensure the plugin was receiving the right config.
Hope this helps a bit more for people running into the same issue
Coming back as I have more info for you. This error, for me, came from the scopes array not having any values in it, or the plugin wasn't fetching the right capacitor.config version. I'd suggest going into the java code for the plugin and doing some logging.
In the
CapConfig.javafile I added this log:public PluginConfig getPluginConfiguration(String pluginId) { PluginConfig pluginConfig = pluginsConfiguration.get(pluginId); Log.d("pluginConfig", pluginConfig.getConfigJSON().toString()); if (pluginConfig == null) { pluginConfig = new PluginConfig(new JSONObject()); } return pluginConfig; }to ensure the plugin was receiving the right config.
Hope this helps a bit more for people running into the same issue
@ianaddictinggames This issue is causing the android emulator to fail when running the app. I try to log the plugin config but get the error "error: cannot find symbol Log.d("pluginConfig", pluginConfig.getConfigJSON().toString());"
Do you know of a way to get around this issue without logging the plugin config?
Thanks
Same error here, I'm using Ionic React with this versions:
{ "dependencies": { "@capacitor/android": "4.4.0", "@capacitor/app": "4.1.0", "@capacitor/core": "^4.5.0", "@capacitor/haptics": "4.0.1", "@capacitor/ios": "4.4.0", "@capacitor/keyboard": "4.0.1", "@capacitor/status-bar": "4.0.1", "@codetrix-studio/capacitor-google-auth": "^3.2.0", "@ionic/react": "^6.0.0", "@ionic/react-router": "^6.0.0", "@testing-library/jest-dom": "^5.11.9", "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^12.6.3", "@types/jest": "^26.0.20", "@types/node": "^12.19.15", "@types/react": "^18.0.17", "@types/react-dom": "^18.0.6", "@types/react-router": "^5.1.11", "@types/react-router-dom": "^5.1.7", "firebase": "^9.14.0", "ionicons": "^6.0.3", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router": "^5.2.0", "react-router-dom": "^5.2.0", "react-scripts": "^5.0.0", "typescript": "^4.1.3", "web-vitals": "^0.2.4", "workbox-background-sync": "^5.1.4", "workbox-broadcast-update": "^5.1.4", "workbox-cacheable-response": "^5.1.4", "workbox-core": "^5.1.4", "workbox-expiration": "^5.1.4", "workbox-google-analytics": "^5.1.4", "workbox-navigation-preload": "^5.1.4", "workbox-precaching": "^5.1.4", "workbox-range-requests": "^5.1.4", "workbox-routing": "^5.1.4", "workbox-strategies": "^5.1.4", "workbox-streams": "^5.1.4" } }
Any idea about how fix this bug ?