我有一个ionic 3项目。我不得不更新一些插件和一些离子模块(以及corodva)。更新后,我可以在项目中添加android平台,但不能再在android设备上运行!!! 这是错误:
> cordova run android --device
cp: copyFileSync: could not write to dest file (code=ENOENT):D:\roxangit\roxanne-beta\platforms\android\res\xml\config.xml
Parsing D:\roxangit\roxanne-beta\platforms\android\res\xml\config.xml failed
(node:9760) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open 'D:\roxangit\roxanne-beta\platforms\android\res\xml\config.xml'
似乎“ cordova platform add android”命令未创建所需的文件和文件夹!
这是我的离子信息:
Ionic:
ionic (Ionic CLI) : 4.1.2 (C:\Users\Xarrin\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : none
Cordova Plugins : cordova-plugin-ionic 5.2.4, cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 2.1.4, (and 15 other plugins)
System:
Android SDK Tools : 26.1.1 (C:\Users\Xarrin\AppData\Local\Android\sdk)
NodeJS : v6.9.0 (C:\Program Files\nodejs\node.exe)
npm : 3.10.8
OS : Windows 10
这已不再添加android平台了:
> cordova platform add android --save
Using cordova-fetch for cordova-android@~7.0.0
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: com.ionicframework.roxannebeta
Name: roxanne_beta
Activity: MainActivity
Android target: android-26
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@7.0.0
Android Studio project detected
Android Studio project detected
Installing "cordova-open-native-settings" for android
Installing "cordova-plugin-add-swift-support" for android
Installing "cordova-plugin-console" for android
Installing "cordova-plugin-device" for android
Installing "cordova-plugin-file" for android
The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.
If this is a new application no changes are required.
If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:
"<preference name="AndroidPersistentFileLocation" value="Compatibility" />"
to config.xml in order for the application to find previously stored files.
Installing "cordova-plugin-file-transfer" for android
Plugin dependency "cordova-plugin-file@6.0.1" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Installing "cordova-plugin-http" for android
Plugin dependency "cordova-plugin-file@6.0.1" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Installing "cordova-plugin-ionic" for android
Plugin dependency "cordova-plugin-splashscreen@5.0.2" already fetched, using that version.
Installing "cordova-plugin-splashscreen" for android
Plugin dependency "cordova-plugin-ionic-webview@2.1.4" already fetched, using that version.
Installing "cordova-plugin-ionic-webview" for android
Subproject Path: CordovaLib
Subproject Path: app
Plugin dependency "cordova-plugin-file@6.0.1" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Plugin dependency "cordova-plugin-file-transfer@1.7.1" already fetched, using that version.
Dependent plugin "cordova-plugin-file-transfer" already installed on android.
Installing "cordova-plugin-ionic-keyboard" for android
Plugin "cordova-plugin-ionic-webview" already installed on android. Making it top-level.
Installing "cordova-plugin-network-information" for android
Plugin "cordova-plugin-splashscreen" already installed on android. Making it top-level.
Installing "cordova-plugin-statusbar" for android
Installing "cordova-plugin-vibration" for android
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Installing "cordova-plugin-zeroconf" for android
Plugin dependency "cordova-plugin-add-swift-support@1.7.2" already fetched, using that version.
Dependent plugin "cordova-plugin-add-swift-support" already installed on android.
Subproject Path: CordovaLib
Subproject Path: app
Installing "cordova-sqlite-storage" for android
installing external dependencies via npm
npm install of external dependencies ok
Installing "ionic-plugin-keyboard" for android
Failed to install 'ionic-plugin-keyboard': Error: ENOENT: no such file or directory, open 'D:\roxangit\roxanne-beta\platforms\android\AndroidManifest.xml'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.readFileSync (fs.js:508:33)
at Object.parseElementtreeSync (D:\roxangit\roxanne-beta\platforms\android\cordova\node_modules\cordova-common\src\util\xml-helpers.js:180:27)
at new AndroidManifest (D:\roxangit\roxanne-beta\platforms\android\cordova\lib\AndroidManifest.js:29:20)
at AndroidProject.getPackageName (D:\roxangit\roxanne-beta\platforms\android\cordova\lib\AndroidProject.js:99:12)
at Api.addPlugin (D:\roxangit\roxanne-beta\platforms\android\cordova\Api.js:223:57)
at handleInstall (C:\Users\Xarrin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:594:10)
at C:\Users\Xarrin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:357:28
at _fulfilled (C:\Users\Xarrin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:787:54)
(node:9752) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open 'D:\roxangit\roxanne-beta\platforms\android\AndroidManifest.xml'
> ionic cordova resources android --force
√ Collecting resource configuration and source images - done!
√ Filtering out image resources that do not need regeneration - done!
√ Uploading source images to prepare for transformations: 2 / 2 complete - done!
√ Generating platform resources: 18 / 18 complete - done!
√ Modifying config.xml to add new image resources - done!
请帮助我!如果我无法运行或构建项目,那么我将无法处理我的项目。