自从过去3天以来,我在这里遇到了一些问题。我的应用在浏览器和android上运行良好。立即停止工作,我尝试了从SO到Github的大量解决方案。但我无法使其正常工作。
这是我的package.json
{
"name": "MyApp",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"launch:on:device": "ionic cordova run android --target=emulator-5554",
"emulate": "ionic cordova emulate android --livereload --emulator=emulator-5554"
},
"config": {
"ionic_copy": "./config/copy.config.js",
"ionic_sass": "./config/sass.config.js"
},
"dependencies": {
"@angular/animations": "^4.4.7",
"@angular/common": "4.4.3",
"@angular/compiler": "4.4.3",
"@angular/compiler-cli": "4.4.3",
"@angular/core": "4.4.3",
"@angular/fire": "^5.0.0-rc.3",
"@angular/forms": "4.4.3",
"@angular/http": "4.4.3",
"@angular/platform-browser": "4.4.3",
"@angular/platform-browser-dynamic": "4.4.3",
"@angular/tsc-wrapped": "^4.4.7",
"@ionic-native/base64": "^4.17.0",
"@ionic-native/calendar": "^4.3.3",
"@ionic-native/camera": "^4.15.0",
"@ionic-native/core": "^5.0.0-beta.24",
"@ionic-native/file": "^4.17.0",
"@ionic-native/file-path": "^4.17.0",
"@ionic-native/file-transfer": "^4.17.0",
"@ionic-native/firebase": "^4.17.0",
"@ionic-native/geolocation": "^5.5.0",
"@ionic-native/image-picker": "^5.2.0",
"@ionic-native/media": "^4.17.0",
"@ionic-native/media-capture": "^4.17.0",
"@ionic-native/native-geocoder": "^5.5.0",
"@ionic-native/native-storage": "^4.20.0",
"@ionic-native/network-interface": "^4.20.0",
"@ionic-native/social-sharing": "^4.17.0",
"@ionic-native/splash-screen": "4.3.0",
"@ionic-native/sqlite": "^5.2.0",
"@ionic-native/status-bar": "4.3.3",
"@ionic-native/web-intent": "^4.20.0",
"@ionic/storage": "^2.2.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.6",
"@ngx-translate/core": "^9.0.1",
"@ngx-translate/http-loader": "^2.0.1",
"@types/leaflet": "^1.2.14",
"angular-froala-wysiwyg": "^2.9.1",
"angularfire2": "^5.1.0",
"autoprefixer": "^9.3.1",
"bootstrap": "^4.3.1",
"code-push": "^2.0.6",
"com-badrit-base64": "^0.2.0",
"com-darryncampbell-cordova-plugin-intent": "1.1.7",
"cordova-android": "6.4.0",
"cordova-android-support-gradle-release": "^2.0.1",
"cordova-browser": "5.0.4",
"cordova-ios": "5.0.1",
"cordova-plugin-calendar": "^4.6.0",
"cordova-plugin-camera": "^2.4.1",
"cordova-plugin-code-push": "^1.11.17",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-dialogs": "^2.0.1",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-filepath": "^1.5.1",
"cordova-plugin-firebase": "git+https://github.com/dpa99c/cordova-plugin-firebase.git#GH-1057-April-05-android-build-issue",
"cordova-plugin-geolocation": "4.0.1",
"cordova-plugin-ionic-webview": "^4.1.0",
"cordova-plugin-media": "^3.0.1",
"cordova-plugin-media-capture": "^3.0.2",
"cordova-plugin-nativegeocoder": "3.2.2",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-networkinterface": "2.0.0",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-statusbar": "git+https://github.com/apache/cordova-plugin-statusbar.git",
"cordova-plugin-telerik-imagepicker": "^2.3.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.4.4",
"cordova-plugin-zip": "^3.1.0",
"cordova-sqlite-storage": "^2.6.0",
"cross-env": "^5.2.0",
"date-fns": "^1.29.0",
"dom-to-image": "^2.6.0",
"es6-promise-plugin": "^4.2.2",
"file-saver": "^2.0.2",
"firebase": "^5.5.8",
"html2canvas": "^1.0.0-rc.1",
"intl": "^1.2.5",
"ionic-angular": "3.7.1",
"ionic-emoji-picker": "^0.1.8",
"ionic-image-loader": "^4.2.1",
"ionic-long-press": "^1.2.0",
"ionic-plugin-keyboard": "^2.2.1",
"ionic-select-searchable": "^2.10.0",
"ionic-swipe-all": "^2.0.0",
"ionic2-auto-complete": "^1.5.3-beta",
"ionic2-calendar": "^0.3.11",
"ionic2-rating": "^1.2.2",
"ionic2-super-tabs": "^4.3.1",
"ionic3-calendar": "^1.1.6",
"ionicons": "3.0.0",
"leaflet": "^1.3.4",
"leaflet.markercluster": "^1.4.1",
"moment": "^2.19.2",
"ng2-bootstrap": "^1.6.3",
"ng4-intl-phone": "^1.2.1",
"ngx-dropdown": "0.0.22",
"protractor-ionic-locator": "0.0.1",
"rxjs": "^6.3.3",
"rxjs-compat": "^6.3.3",
"setimmediate": "^1.0.5",
"sw-toolbox": "3.6.0",
"time-ago-pipe": "^1.3.2",
"typescript-require": "^0.2.10",
"validator": "^9.1.1",
"whitelist": "^1.0.2",
"xcode": "^2.0.0",
"xml-js": "^1.6.11",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.2.3",
"@ionic/lab": "1.0.9",
"@types/jasmine": "^2.8.11",
"@types/leaflet-markercluster": "^1.0.3",
"@types/leaflet.locatecontrol": "^0.60.7",
"@types/node": "^8.10.37",
"connect": "^3.6.6",
"gulp": "^4.0.2",
"jasmine": "^2.99.0",
"jasmine-spec-reporter": "^4.2.1",
"ts-node": "^4.1.0",
"typescript": "2.3.4"
},
"description": "An Ionic project",
"cordova": {
"platforms": [
"browser",
"ios"
],
"plugins": {
"ionic-plugin-keyboard": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-calendar": {
"CALENDAR_USAGE_DESCRIPTION": " "
},
"cordova-plugin-file-transfer": {},
"cordova-plugin-filepath": {},
"cordova-plugin-media": {},
"cordova-sqlite-storage": {},
"cordova-plugin-firebase": {},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
},
"cordova-plugin-file": {},
"cordova-plugin-code-push": {},
"cordova-plugin-zip": {},
"com-badrit-base64": {},
"cordova-plugin-telerik-imagepicker": {
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "App wants to access your gallery"
},
"cordova-plugin-nativestorage": {},
"cordova-plugin-geolocation": {},
"cordova-plugin-nativegeocoder": {},
"com-darryncampbell-cordova-plugin-intent": {},
"cordova-plugin-networkinterface": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-camera": {},
"cordova-plugin-compat": {},
"cordova-plugin-media-capture": {}
}
}
}
在浏览器上一切都很好,但是当我在移动设备上进行测试时,这些功能都不起作用。在某些设备上,我什至无法访问互联网,但AndroidManifest.xml中存在权限android.permission.INTERNET
。
我也尝试了This和this,还有更多...删除和添加平台不会改变任何内容。它总是会捕获 plugin_not_installed
如果我运行cordova plugin list
存在插件
这是我的输出
code-push 2.0.6 "CodePushAcquisition"
com-badrit-base64 0.2.0 "Base64"
com-darryncampbell-cordova-plugin-intent 1.1.7 "Intent Shim"
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-calendar 4.6.0 "Calendar"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-code-push 1.11.13 "CodePush"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-firebase 0.1.25 "Google Firebase Plugin"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-ionic-webview 4.1.0 "cordova-plugin-ionic-webview"
cordova-plugin-media 3.0.1 "Media"
cordova-plugin-nativegeocoder 3.2.2 "NativeGeocoder"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-networkinterface 2.0.0 "NetworkInterface"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-statusbar 2.4.3-dev "StatusBar"
cordova-plugin-telerik-imagepicker 2.2.4 "ImagePicker"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.2.1 "SocialSharing"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
cordova-sqlite-storage 2.3.3 "Cordova sqlite storage plugin"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"
请帮助!
答案 0 :(得分:0)
执行以下步骤1.删除 package-lock.json 和节点模块 2.使用 npm缓存验证 3.运行 npm install
还尝试删除android并再次添加平台。祝你好运
ionic cordova platform rm android
ionic cordova platform add android