Ionic 3:安装了cordova-plugin-camera和Native Web-intent后,Android添加平台失败了

Ionic 3:安装了cordova-plugin-camera和Native Web-intent后,Android添加平台失败了,第1张

概述首先,感谢您抽出时间帮助我! 摘要: 试图将cordova-plugin-camera添加到我的离子3项目中. 经过许多失败并最终取得成功,现在我的应用程序不再构建在我的android上了. ——–开始编辑——– 经过多次测试后,当我安装了插件摄像头和web-intent时,似乎存在冲突/问题. 这两个插件都来自Ionic Native: > camera plugin:cordova-plugi 首先,感谢您抽出时间帮助我!

摘要:

试图将cordova-plugin-camera添加到我的离子3项目中.
经过许多失败并最终取得成功,现在我的应用程序不再构建在我的android上了.

——–开始编辑——–

经过多次测试后,当我安装了插件摄像头和web-intent时,似乎存在冲突/问题.

这两个插件都来自Ionic Native:

> camera plugin:cordova-plugin-camera
> web-intent:com-darryncampbell-cordova-plugin-intent

——–结束编辑——–

我的离子信息

cli packages: (C:\Users\[...]\AppData\Roaming\npm\node_modules)        @ionic/cli-utils  : 1.9.2        ionic (Ionic Cli) : 3.9.2    global packages:        Cordova Cli : 7.0.1    local packages:        @ionic/app-scripts : 2.1.3        Cordova Platforms  : androID 6.2.3        Ionic Framework    : ionic-angular 3.6.0    System:        Node : v8.1.2        npm  : 5.0.3        OS   : windows 10

我采取的步骤(一点历史):

我无法安装相机插件,因为cordova-plugin-compat的版本不兼容(可以在很多论坛中找到).
所以我遵循了一些步骤:

>删除了cordova-plugin-compat v1.0.0 –force
>安装了最新版本的cordova-plugin-compat@1.1.0
> – >运行androID:我的应用程序仍在我的设备上运行并运行(检查!)

然后我尝试安装相机插件:

> ionic cordova插件添加cordova-plugin-camera
>这是我得到的:

> cordova plugin add cordova-plugin-camera --save× Running command - Failed![ERROR] An error occurred while running cordova plugin add cordova-plugin-camera --save (exit code 1):Installing "cordova-plugin-camera" for androIDPlugin dependency "cordova-plugin-compat@1.1.0" already fetched,using that version.Dependent plugin "cordova-plugin-compat" already installed on androID.[...]BUILD SUCCESSFulError during processing of action! Attempting to revert...Failed to install 'cordova-plugin-camera': Error     at copyNewfile(C:\[...]\platforms\androID\cordova\lib\pluginHandlers.Js:248:15)     at install (C:\[...]\platforms\androID\cordova\lib\pluginHandlers.Js:43:17)     at ActionStack.process(C:\[...]\platforms\androID\cordova\node_modules\cordova-common\src\ActionStack.Js:56:25)     at PluginManager.doOperation(C:\[...]\platforms\androID\cordova\node_modules\cordova-common\src\PluginManager.Js:117:20)     at PluginManager.addplugin(C:\[...]\platforms\androID\cordova\node_modules\cordova-common\src\PluginManager.Js:147:17)     at C:\[...]\platforms\androID\cordova\API.Js:254:18     at _fulfilled(C:\[...]\platforms\androID\cordova\node_modules\q\q.Js:854:54)     at self.promisedispatch.done(C:\[...]\platforms\androID\cordova\node_modules\q\q.Js:883:30)     at Promise.promise.promisedispatch(C:\[...]\platforms\androID\cordova\node_modules\q\q.Js:816:13)     at C:\[...]\platforms\androID\cordova\node_modules\q\q.Js:624:44Error: Uh oh!"C:\[...]\platforms\androID\res\xml\provIDer_paths.xml" already exists!

那么,我继续按照我在其他线程中看到的关于相机插件问题的步骤:

>删除androID平台
> ionic cordova插件添加cordova-plugin-camera
> – >插件安装成功! (在那里,我想,太棒了!)

所以我加回平台:

>离子cordova平台添加androID
>和BOOM:

> cordova platform add androID --save× Running command - Failed![ERROR] Exception: Using cordova-fetch for cordova-androID@~6.2.2Adding androID project...Creating Cordova project for the AndroID platform:        Path: platforms\androID        Package: com.app.app        name: app        Activity: MainActivity        AndroID target: androID-25Subproject Path: CordovalibAndroID project created with cordova-androID@6.2.3Installing "com-darryncampbell-cordova-plugin-intent" for androIDSubproject Path: CordovalibInstalling "cordova-plugin-camera" for androIDPlugin dependency "cordova-plugin-compat@1.1.0" already fetched,using that version.Installing "cordova-plugin-compat" for androIDError during processing of action! Attempting to revert...Failed to install 'cordova-plugin-camera': Error     at copyNewfile(C:\[...]\platforms\androID\cordova\lib\pluginHandlers.Js:248:15)     at install (C:\[...]\platforms\androID\cordova\lib\pluginHandlers.Js:43:17)     at ActionStack.process(C:\[...]\platforms\androID\cordova\node_modules\cordova-common\src\ActionStack.Js:56:25)     at PluginManager.doOperation(C:\[...]\platforms\androID\cordova\node_modules\cordova-common\src\PluginManager.Js:117:20)     at PluginManager.addplugin(C:\[...]\platforms\androID\cordova\node_modules\cordova-common\src\PluginManager.Js:147:17)     at C:\[...]\platforms\androID\cordova\API.Js:254:18     at _fulfilled(C:\[...]\platforms\androID\cordova\node_modules\q\q.Js:854:54)     at self.promisedispatch.done(C:\[...]\platforms\androID\cordova\node_modules\q\q.Js:883:30)     at Promise.promise.promisedispatch(C:\[...]\platforms\androID\cordova\node_modules\q\q.Js:816:13)     at C:\[...]\platforms\androID\cordova\node_modules\q\q.Js:570:49Error: Uh oh!"C:\[...]\platforms\androID\res\xml\provIDer_paths.xml" already exists!

最后一步,我运行npm install -g cordova ionic

npm WARN deprecated node-uuID@1.4.8: Use uuID module instead    C:\Users\[...]\AppData\Roaming\npm\ionic -> C:\Users\[...]\AppData\Roaming\npm\node_modules\ionic\bin\ionic    C:\Users\[...]\AppData\Roaming\npm\cordova -> C:\Users\[...]\AppData\Roaming\npm\node_modules\cordova\bin\cordova    + ionic@3.9.2    + cordova@7.0.1    added 5 packages,removed 6 packages and updated 42 packages in 55.193s

和离子cordova平台再次添加androID,但现在它告诉我:

> cordova platform add androID --save    × Running command - Failed!    [WARN] Platform already added. Saving platforms to config.xml.    > cordova platform save    √ Running command - done!

如果我尝试离子cordova运行androID:

> cordova platform add androID --save    × Running command - Failed!    [WARN] Platform already added. Saving platforms to config.xml.    > cordova platform save    √ Running command - done!    [INFO] Running app-scripts build: --platform androID --target cordova    [...]    > ionic cordova prepare    [WARN] No Cordova platforms Listed in config.xml. nothing to prepare.    You can save your installed platforms to config.xml with the ionic cordova platform save command.

和离子cordova平台保存命令不会改变一件事.

——–开始编辑——–
然后我尝试创建一个全新的项目并逐个添加插件,从相机开始,并在安装完每个插件后在我的设备上重建/运行…这一切都很好,直到最后一个,这是网络-intent插件,我遇到了和以前一样的问题:

Error: Uh oh!            "C:\[...]\newApp\platforms\androID\res\xml\provIDer_paths.xml" already exists!

卸载它,删除并重新添加平台,然后再次构建,编译和运行设备工作.

——–结束编辑——–

这是我拥有的所有插件的列表:

com-darryncampbell-cordova-plugin-intent 0.0.14 "Intent Shim"    cordova-plugin-camera 2.4.1 "Camera"    cordova-plugin-compat 1.1.0 "Compat"    cordova-plugin-console 1.0.5 "Console"    cordova-plugin-device 1.1.4 "Device"    cordova-plugin-facebook4 1.9.1 "Facebook Connect"    cordova-plugin-file 4.3.3 "file"    cordova-plugin-file-transfer 1.6.3 "file Transfer"    cordova-plugin-photo-library 2.1.0 "Photo library"    cordova-plugin-splashscreen 4.0.3 "Splashscreen"    cordova-plugin-2.2.2 "Statusbar"    cordova-plugin-whiteList 1.3.1 "WhiteList"    cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"    ionic-plugin-keyboard 2.2.1 "Keyboard"

不确定我是否需要降级Ionic或Cordova Cli,Ionic或cordova平台或其他任何东西才能使其工作.

再次感谢你的帮助!

解决方法 在ionic3中你不需要添加平台

你刚刚运行离子cordova运行androID它自动添加它

这也是错误的命令据我所知他们没有这样的命令

cordova platform add androID --save // wrong command

正确对象,真爱

ionic cordova run androID // right command directly add platform and run
总结

以上是内存溢出为你收集整理的Ionic 3:安装了cordova-plugin-camera和Native Web-intent后,Android添加平台失败了全部内容,希望文章能够帮你解决Ionic 3:安装了cordova-plugin-camera和Native Web-intent后,Android添加平台失败了所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1001974.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存