简体   繁体   English

离子Android应用程序无法构建

[英]Ionic Android Application not building

C:\\Users\\Tuladhar\\WebstormProjects\\myproject>ionic cordova build android [WARN] Not performing Ionic build for project type: ionic1. C:\\ Users \\ Tuladhar \\ WebstormProjects \\ myproject> ionic cordova build android [WARN]未对项目类型ionic1执行离子构建。

cordova build android Running command: "C:\\Program Files\\nodejs\\node.exe" C:\\Users\\Tuladhar\\WebstormProjects\\myproject\\hooks\\after_prepare\\010_add_platform_class.js C:\\Users\\Tuladhar\\WebstormProjects\\myproject cordova build android运行命令:“ C:\\ Program Files \\ nodejs \\ node.exe” C:\\ Users \\ Tuladhar \\ WebstormProjects \\ myproject \\ hooks \\ after_prepare \\ 010_add_platform_class.js C:\\ Users \\ Tuladhar \\ WebstormProjects \\ myproject

add to body class: platform-android ANDROID_HOME=C:\\Users\\Tuladhar\\AppData\\Local\\Android\\android-sdk JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_121 Subproject Path: CordovaLib The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. 添加到主体类:platform-android ANDROID_HOME = C:\\ Users \\ Tuladhar \\ AppData \\ Local \\ Android \\ android-sdk JAVA_HOME = C:\\ Program Files \\ Java \\ jdk1.8.0_121子项目路径:CordovaLib Task.leftShift(Closure )方法已被弃用,并计划在Gradle 5.0中删除。 Please use Task.doLast(Action) instead. 请改用Task.doLast(Action)。

    at build_859uxik73yildsrgrru9xamjo.run(C:\Users\Tuladhar\WebstormProjects\myproject\platforms\android\build.gradle:141)

BUILD FAILED 建立失败

Total time: 22.164 secs FAILURE: Build failed with an exception. 总时间:22.164秒失败:生成失败,并发生异常。

  • What went wrong: A problem occurred configuring root project 'android'. 出了什么问题:配置根项目“ android”时出现问题。

    Could not resolve all dependencies for configuration ':_debugApk'. 无法解析配置':_debugApk'的所有依赖项。 A problem occurred configuring project ':CordovaLib'. 配置项目':CordovaLib'时发生问题。 Could not open cp_proj remapped class cache for cxcpcn2de84br0eekalu3p9nv (C:\\Users\\Tuladhar.gradle\\caches\\3.3\\scripts-remapped\\build_c7ur6ql0tv1x27ryhuthd38ad\\cxcpcn2de84br0eekalu3p9nv\\cp_proj1efd45104ffa2d33563b85b9edda76e3). 无法打开cxcpcn2de84br0eekalu3p9nv的cp_proj重新映射的类缓存(C:\\ Users \\ Tuladhar.gradle \\ caches \\ 3.3 \\ scripts-remapped \\ build_c7ur6ql0tv1x27ryhuthd38ad \\ cxcpcn2de84br0eekalu3p3b9ad85d7a7d3d9b1e3d9b3d9a3d9a3d9b1e2e3d9b0e7e7e7e0e0e0f0b0b0e7e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e人 Unexpected lock protocol found in lock file. 在锁定文件中找到意外的锁定协议。 Expected 3, found 0. 预期为3,发现为0。

  • Try: Run with --stacktrace option to get the stack trace. 尝试:使用--stacktrace选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output. 使用--info或--debug选项运行以获取更多日志输出。 Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception. 错误:cmd:命令失败,退出代码为1错误输出:FAILURE:构建因异常而失败。

  • What went wrong: A problem occurred configuring root project 'android'. 出了什么问题:配置根项目“ android”时出现问题。

    Could not resolve all dependencies for configuration ':_debugApk'. 无法解析配置':_debugApk'的所有依赖项。 A problem occurred configuring project ':CordovaLib'. 配置项目':CordovaLib'时发生问题。 Could not open cp_proj remapped class cache for cxcpcn2de84br0eekalu3p9nv (C:\\Users\\Tuladhar.gradle\\caches\\3.3\\scripts-remapped\\build_c7ur6ql0tv1x27ryhuthd38ad\\cxcpcn2de84br0eekalu3p9nv\\cp_proj1efd45104ffa2d33563b85b9edda76e3). 无法打开cxcpcn2de84br0eekalu3p9nv的cp_proj重新映射的类缓存(C:\\ Users \\ Tuladhar.gradle \\ caches \\ 3.3 \\ scripts-remapped \\ build_c7ur6ql0tv1x27ryhuthd38ad \\ cxcpcn2de84br0eekalu3p3b9ad85d7a7d3d9b1e3d9b3d9a3d9a3d9b1e2e3d9b0e7e7e7e0e0e0f0b0b0e7e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e0e人 Unexpected lock protocol found in lock file. 在锁定文件中找到意外的锁定协议。 Expected 3, found 0. 预期为3,发现为0。

  • Try: Run with --stacktrace option to get the stack trace. 尝试:使用--stacktrace选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output. 使用--info或--debug选项运行以获取更多日志输出。

[ERROR] An error occurred while running cordova build android (exit code 1). [错误]运行cordova build android(退出代码1)时发生错误。

1.Remove platforms (you can delete it from folder) 1.删​​除平台(可以从文件夹中删除)

2.Remove node_modules (you can delete it from folder) 2.删除node_modules(您可以从文件夹中删除它)

3.Upgrade your ionic-cli version to the latest ( npm update -g ionic ) 3.将您的ionic-cli版本升级到最新版本( npm update -g ionic

4.run npm install 4. npm install

5.run ionic cordova platform add android 5.运行ionic cordova platform add android

6.run ionic cordova run android 6. ionic cordova run android

Try these steps accordingly and it will work. 相应地尝试这些步骤,它将起作用。 If not try updating android api and sdk tools and re-do the steps. 如果没有尝试更新android api和sdk工具,然后重新执行步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM