无法将Android平台添加到离子项目中

问题描述 投票:-1回答:1

我正在尝试构建APK,但出现此错误

Discovered saved plugin "im.ltdev.cordova.UserAgent". Adding it to the project
Failed to restore plugin "im.ltdev.cordova.UserAgent" from config.xml. You might need to try adding it again. Error: Error: npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Not found : im.ltdev.cordova.UserAgent
npm ERR! 404
npm ERR! 404  'im.ltdev.cordova.UserAgent' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because
npm ERR! 404  1. name can no longer contain capital letters
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Desarrollo\AppData\Roaming\npm-cache\_logs\2020-01-28T17_27_27_131Z-debug.log
Discovered saved plugin "cordova-plugin-firebase". Adding it to the project
Failed to restore plugin "cordova-plugin-firebase" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin git+https://github.com/dpa99c/cordova-plugin-firebase.git#GH-1057-April-05-android-build-issue via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ENOGIT
npm ERR! Error while executing:
npm ERR! undefined ls-remote -h -t https://github.com/dpa99c/cordova-plugin-firebase.git
npm ERR!
npm ERR! undefined
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Desarrollo\AppData\Roaming\npm-cache\_logs\2020-01-28T17_27_31_601Z-debug.log
cordova-android-support-gradle-release: Android platform: V7+
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Users\Desarrollo\Desktop\lugus-3-0\platforms\android\app\build.gradle
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Users\Desarrollo\Desktop\lugus-3-0\platforms\android\cordova-android-support-gradle-release\SanDiego-cordova-android-support-gradle-release.gradle
cordova-plugin-androidx: Updated gradle.properties to enable AndroidX
cordova-plugin-androidx-adapter: Processed 18 Java source files in 450ms
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd platform add android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

这是我的离子信息

Ionic:

Ionic CLI:5.4.15(C:\ Users \ Desarrollo \ AppData \ Roaming \ npm \ node_modules \ ionic)离子框架:@ ionic / angular 4.0.0-beta.17@ angular-devkit / build-angular:0.803.23@ angular-devkit / schematics:7.0.7@ angular / cli:7.0.7@ ionic / angular-toolkit:1.2.0

科尔多瓦:Cordova CLI:未安装Cordova平台:Android 8.1.0Cordova插件:cordova-plugin-ionic-keyboard 2.2.0,cordova-plugin-ionic-webview 2.5.2(和其他10个插件)

实用程序:科尔多瓦水库:0.9.0本机运行:未安装

系统:NodeJS:v11.1.0(C:\ Program Files \ nodejs \ node.exe)npm:6.4.1操作系统:Windows 10

android angular cordova-plugins ionic4
1个回答
0
投票

似乎在package.json中您有错误的节点模块名称。

请更新您的package.json以使用cordova-plugin-agent,清理cordova-plugin-agent目录和NPM缓存并重新安装。

希望有帮助。

也请参考具有相同信息的此问题node_modules

© www.soinside.com 2019 - 2024. All rights reserved.