代码之家  ›  专栏  ›  技术社区  ›  Zagham

离子6。当我生成但未打开时,应用程序崩溃

  •  0
  • Zagham  · 技术社区  · 2 年前

    当我打开应用程序时,会出现Logcat错误,当我打开应用程序时,应用程序会崩溃,并且会一次又一次地崩溃。我认为这是firebase的问题,或者需要一些帮助来解决这个问题。一个星期以来,我一直在降级和升级所有插件,但徒劳,没有得到任何解决方案。

    package.json :

    {
      "name": "fcmNotifications",
      "version": "0.0.1",
      "author": "Ionic Framework",
      "homepage": "https://ionicframework.com/",
      "scripts": {
        "ng": "ng",
        "start": "ng serve",
        "build": "ng build",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e"
      },
      "private": true,
      "dependencies": {
        "@angular/common": "~13.2.2",
        "@angular/core": "~13.2.2",
        "@angular/fire": "^7.4.1",
        "@angular/forms": "~13.2.2",
        "@angular/platform-browser": "~13.2.2",
        "@angular/platform-browser-dynamic": "~13.2.2",
        "@angular/router": "~13.2.2",
        "@capacitor-community/fcm": "^2.0.2",
        "@capacitor-firebase/authentication": "^0.3.1",
        "@capacitor/android": "^3.5.1",
        "@capacitor/app": "1.1.1",
        "@capacitor/browser": "1.0.7",
        "@capacitor/camera": "^1.3.1",
        "@capacitor/core": "3.5.1",
        "@capacitor/haptics": "1.1.4",
        "@capacitor/keyboard": "1.2.2",
        "@capacitor/push-notifications": "^1.0.9",
        "@capacitor/status-bar": "1.0.8",
        "@ionic/angular": "^6.0.0",
        "date-fns": "^2.28.0",
        "firebase": "^9.8.4",
        "rxjs": "~6.6.0",
        "tslib": "^2.2.0",
        "zone.js": "~0.11.4"
      },
      "devDependencies": {
        "@angular-devkit/build-angular": "~13.2.3",
        "@angular-eslint/builder": "~13.0.1",
        "@angular-eslint/eslint-plugin": "~13.0.1",
        "@angular-eslint/eslint-plugin-template": "~13.0.1",
        "@angular-eslint/template-parser": "~13.0.1",
        "@angular/cli": "~13.2.3",
        "@angular/compiler": "~13.2.2",
        "@angular/compiler-cli": "~13.2.2",
        "@angular/language-service": "~13.2.2",
        "@capacitor/cli": "3.5.1",
        "@ionic/angular-toolkit": "^6.0.0",
        "@types/jasmine": "~3.6.0",
        "@types/jasminewd2": "~2.0.3",
        "@types/node": "^12.11.1",
        "@typescript-eslint/eslint-plugin": "5.3.0",
        "@typescript-eslint/parser": "5.3.0",
        "eslint": "^7.6.0",
        "eslint-plugin-import": "2.22.1",
        "eslint-plugin-jsdoc": "30.7.6",
        "eslint-plugin-prefer-arrow": "1.2.2",
        "jasmine-core": "~3.8.0",
        "jasmine-spec-reporter": "~5.0.0",
        "karma": "~6.3.2",
        "karma-chrome-launcher": "~3.1.0",
        "karma-coverage": "~2.0.3",
        "karma-coverage-istanbul-reporter": "~3.0.2",
        "karma-jasmine": "~4.0.0",
        "karma-jasmine-html-reporter": "^1.5.0",
        "protractor": "~7.0.0",
        "ts-node": "~8.3.0",
        "typescript": "~4.4.4"
      },
      "description": "An Ionic project"
    }
    

        Process: com.learn2earn.fcm, PID: 1811
        java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/auth/api/signin/GoogleSignIn;
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.handlers.GoogleAuthProviderHandler.buildGoogleSignInClient(GoogleAuthProviderHandler.java:100)
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.handlers.GoogleAuthProviderHandler.buildGoogleSignInClient(GoogleAuthProviderHandler.java:78)
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.handlers.GoogleAuthProviderHandler.<init>(GoogleAuthProviderHandler.java:34)
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthentication.initAuthProviderHandlers(FirebaseAuthentication.java:392)
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthentication.<init>(FirebaseAuthentication.java:51)
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthenticationPlugin.load(FirebaseAuthenticationPlugin.java:38)
            at com.getcapacitor.PluginHandle.load(PluginHandle.java:95)
            at com.getcapacitor.PluginHandle.<init>(PluginHandle.java:59)
            at com.getcapacitor.Bridge.registerPlugin(Bridge.java:509)
            at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:464)
            at com.getcapacitor.Bridge.<init>(Bridge.java:191)
            at com.getcapacitor.Bridge.<init>(Bridge.java:65)
            at com.getcapacitor.Bridge$Builder.create(Bridge.java:1308)
            at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72)
            at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110)
            at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455)
            at android.app.Activity.performStart(Activity.java:8388)
            at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3946)
            at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
            at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
            at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
            at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2423)
            at android.os.Handler.dispatchMessage(Handler.java:106)
            at android.os.Looper.loopOnce(Looper.java:233)
            at android.os.Looper.loop(Looper.java:334)
            at android.app.ActivityThread.main(ActivityThread.java:8333)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)
         Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.auth.api.signin.GoogleSignIn" on path: DexPathList[[zip file "/data/app/~~xzGX5coTs3h0rQrebH6mtw==/com.learn2earn.fcm-ayDF2ytKAEXW8dRbbk151A==/base.apk"],nativeLibraryDirectories=[/data/app/~~xzGX5coTs3h0rQrebH6mtw==/com.learn2earn.fcm-ayDF2ytKAEXW8dRbbk151A==/lib/arm64, /system/lib64, /system/system_ext/lib64]]
            at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.handlers.GoogleAuthProviderHandler.buildGoogleSignInClient(GoogleAuthProviderHandler.java:100) 
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.handlers.GoogleAuthProviderHandler.buildGoogleSignInClient(GoogleAuthProviderHandler.java:78) 
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.handlers.GoogleAuthProviderHandler.<init>(GoogleAuthProviderHandler.java:34) 
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthentication.initAuthProviderHandlers(FirebaseAuthentication.java:392) 
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthentication.<init>(FirebaseAuthentication.java:51) 
            at dev.robingenz.capacitorjs.plugins.firebase.authentication.FirebaseAuthenticationPlugin.load(FirebaseAuthenticationPlugin.java:38) 
            at com.getcapacitor.PluginHandle.load(PluginHandle.java:95) 
            at com.getcapacitor.PluginHandle.<init>(PluginHandle.java:59) 
            at com.getcapacitor.Bridge.registerPlugin(Bridge.java:509) 
            at com.getcapacitor.Bridge.registerAllPlugins(Bridge.java:464) 
            at com.getcapacitor.Bridge.<init>(Bridge.java:191) 
            at com.getcapacitor.Bridge.<init>(Bridge.java:65) 
            at com.getcapacitor.Bridge$Builder.create(Bridge.java:1308) 
            at com.getcapacitor.BridgeActivity.load(BridgeActivity.java:72) 
            at com.getcapacitor.BridgeActivity.onStart(BridgeActivity.java:110) 
            at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455) 
            at android.app.Activity.performStart(Activity.java:8388) 
            at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3946) 
            at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) 
            at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) 
            at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) 
            at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) 
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2423) 
            at android.os.Handler.dispatchMessage(Handler.java:106) 
            at android.os.Looper.loopOnce(Looper.java:233) 
            at android.os.Looper.loop(Looper.java:334) 
            at android.app.ActivityThread.main(ActivityThread.java:8333) 
            at java.lang.reflect.Method.invoke(Native Method) 
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582) 
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065) ```
    
    Unable to debug this issue for a week. I tried to check if there is a conflict with any of the plugins that are being used. But was not able to figure it out. How do I fix this?
    
    1 回复  |  直到 2 年前
        1
  •  0
  •   Martin Zeitler    2 年前

    尝试替换此插件:

    "@capacitor-firebase/authentication": "^0.3.1"
    

    "@capacitor-firebase/authentication": "^0.5.0"
    

    也可以看到这个 issue comment ,这可能还是实际的,也可能不是。