androidionic-frameworkcapacitorcapacitor-plugin

Capacitor App plugins break when setting server to https


I’m working on an Ionic App using Capacitor. Everything has been going well until I needed to change the dev server to use https. However, setting this https server seems to break the App capacitor plugin @capacitor/app. and this error appears

ERROR Error: Uncaught (in promise): Error: "App" plugin is not implemented on android

in capacitor.config.ts :


server: {
  url: "https://test.example.tn",
  androidScheme: "https",
  cleartext: true
},

MainActivity :


import com.getcapacitor.BridgeActivity;

public class MainActivity extends BridgeActivity {}

i tried to upgrade the @capacitor/app to the latest version and changed the Main Activity file few times with no result.

Note : everything works well on http .

Valid certificate :enter image description here


Solution

  • If your server certificates are not valid, capacitor will not be able to inject the plugins JavaScript code and they will not work.