-
Notifications
You must be signed in to change notification settings - Fork 1k
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
bug: Capacitor is not correctly initialized when using a dev server with ssl
on Android
#3707
Comments
can you provide a sample app?
|
You are right on that point, I forgot to mention that I had to manually patch my @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
}});
if (BuildConfig.DEBUG) {
this.bridge.getWebView().setWebViewClient(new BridgeWebViewClient(this.bridge) {
@Override
public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) {
handler.proceed();
}
});
}
} The reason why I need |
The problem is Capacitor is not able to inject the required javascript code because of the bad certificate. You can add this code to ignore the SSL errors on native connections, but remove it before submitting your app, google will probably reject the app if it contains this code.
|
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Bug Report
Capacitor Version
Platform(s)
Current Behavior
ionic capacitor run android --livereload --external --ssl
Capacitor.isNative
is false andCapacitor.platform
is webAs a result, plugins are not working and specifically
SplashScreen
cannot be hidden programmatically when usinglaunchAutoHide: false
.Expected Behavior
Capacitor.isNative
should be true andCapacitor.platform
should be androidOther Technical Details
npm --version
output: 6.14.8node --version
output: v14.10.1Additional Context
On iOS: everything is working as expected.
On Android: everything is working as expected without
ssl
The text was updated successfully, but these errors were encountered: