Ionic在浏览器上工作,但在实际设备上不工作

时间:2019-05-01 00:56:02

标签: ionic-framework ionic3 ionic-native

我想在我的离子项目中添加FCM通知。我的项目在浏览器中成功运行。但它在设备上不起作用。当我运行cordova run android时,该应用程序安装了电话。但是应用程序已停止。安装FCM加载项后发生此事件。 https://github.com/fechanique/cordova-plugin-fcm插件 我尝试了另一个插件,但结果没有改变。 https://ionicframework.com/docs/v3/native/fcm/ 如果有错误,我想看看Inspect Devices。但是它很快关闭,我看不到任何错误。

当我删除插件时,它也可以通过电话成功运行。

如何解决此问题?

我尝试了cordova platform remove androidcordova platform add android,但仍无法正常工作。

cordova run android

Android Studio project detected
Discovered saved plugin "mx.ferreyra.callnumber". Adding it to the project
Plugin "call-number" already installed on android.
ANDROID_HOME=C:\Users\Meftun\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
config.xml
../config.xml
../../config.xml
../../../config.xml
preference = 9
name = ScrollEnabled, value = false
name = android-minSdkVersion, value = 19
name = BackupWebStorage, value = none
name = SplashMaintainAspectRatio, value = true
name = FadeSplashScreenDuration, value = 300
name = SplashShowOnlyFirstTime, value = false
name = SplashScreen, value = screen
name = SplashScreenDelay, value = 3000
name = GOOGLE_MAPS_ANDROID_API_KEY, value = XXXXXXXXXXXXXXXXXXXXXXXX
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_6lv694c3ptnyjchvmgsyczu8h.run(C:\Users\Meftun\Desktop\IonicAktif\kurye-musteri2\kurye-musteri\platforms\android\app\build.gradle:154)
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:prepareLintJar UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:platformAttrExtractor UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:javaPreCompileDebug UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes NO-SOURCE
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:CordovaLib:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:javaPreCompileDebug UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:transformClassesWithStackFramesFixerForDebug UP-TO-DATE
:app:transformClassesWithDesugarForDebug UP-TO-DATE
:app:transformClassesWithDexBuilderForDebug UP-TO-DATE
:app:transformDexArchiveWithExternalLibsDexMergerForDebug UP-TO-DATE
:app:transformDexArchiveWithDexMergerForDebug UP-TO-DATE
:CordovaLib:compileDebugNdk NO-SOURCE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes NO-SOURCE
:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:app:validateSigningDebug
:app:packageDebug UP-TO-DATE
:app:assembleDebug UP-TO-DATE
:app:cdvBuildDebug UP-TO-DATE

BU�LD SUCCESSFUL in 12s
46 actionable tasks: 1 executed, 45 up-to-date
Built the following apk(s):
        C:\Users\Meftun\Desktop\IonicAktif\kurye-musteri2\kurye-musteri\platforms\android\app\build\outputs\apk\debug\app-debug.apk
ANDROID_HOME=C:\Users\Meftun\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
No target specified, deploying to device 'XXXXXXXXXXXXXXXXXXXXXXXX'.
none
Skipping build...
Built the following apk(s):
        C:\Users\Meftun\Desktop\IonicAktif\kurye-musteri2\kurye-musteri\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Using apk: C:\Users\Meftun\Desktop\IonicAktif\kurye-musteri2\kurye-musteri\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Package name: com.kuryemex.cebindekikurye
LAUNCH SUCCESS

ionic info

Ionic:

   ionic (Ionic CLI)  : 4.12.0 (C:\Users\Meftun\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.3
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms     : android 7.1.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 19 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Users\Meftun\AppData\Local\Android\sdk)
   NodeJS            : v8.9.3 (C:\Program Files\nodejs\node.exe)
   npm               : 6.9.0
   OS                : Windows 10

cordova plugin list

call-number 0.0.2 "Cordova Call Number Plugin"
com-sarriaroman-photoviewer 1.1.18 "PhotoViewer"
cordova-background-geolocation-lt 2.14.2 "BackgroundGeolocation"
cordova-open-native-settings 1.5.2 "Native settings"
cordova-plugin-advanced-http 2.0.9 "Advanced HTTP plugin"
cordova-plugin-android-permissions 1.0.0 "Permissions"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-background-fetch 5.4.1 "CDVBackgroundFetch"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-fcm 2.1.2 "FCMPlugin"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-googlemaps 2.6.2 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 3.1.2 "cordova-plugin-ionic-webview"
cordova-plugin-nativegeocoder 3.2.1 "NativeGeocoder"
cordova-plugin-request-location-accuracy 2.2.3 "Request Location Accuracy"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-uniquedeviceid 1.3.2 "UniqueDeviceID"
cordova-plugin-whitelist 1.3.3 "Whitelist"

0 个答案:

没有答案