简体   繁体   English

Ionic 3:自更新Cordova等以来无法构建Android

[英]Ionic 3: Can't build Android since updating Cordova etc

My Ionic 3 project won't build for Android any more. 我的Ionic 3项目不再适用于Android。 Serving to the browser is working. 服务于浏览器正在运行。 I've tried in numerous combinations: 我尝试了很多种组合:

  • removing android platform 删除android平台
  • updating cordova / ionic 更新cordova / ionic
  • re-adding platform 重新添加平台
  • updating the already installed Android Studio SDK tools 更新已安装的Android Studio SDK工具
  • head-butting the computer 头撞电脑
  • downgrading to 6.4.0 by doing: 通过以下方式降级到6.4.0:
    • ionic cordova remove platform android 离子cordova删除平台android
    • ionic cordova add platform android@6.4.0 离子cordova添加平台android@6.4.0
    • ionic cordova build android 离子cordova构建android

…and am still getting the same build error as below. ...我仍然得到与下面相同的构建错误。

I just can't get it to build, not even the official Ionic docs have any info. 我只是无法建立它,甚至官方的Ionic文档都没有任何信息。 Any ideas? 有任何想法吗?

Note: There are loads of outdated answers on the net that haven't worked, so please don't just mark this as a duplicate, as the solution needs to be up to date. 注意:网上有大量过时的答案没有用,所以请不要只是将其标记为重复,因为解决方案需要是最新的。

Error message in console: 控制台中的错误消息:

ANDROID_HOME=/Users/daveshirman/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
studio
(node:16020) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle 
in your path, or install Android Studio

Here's my system version info: 这是我的系统版本信息:

Davids-MBP:apphazard-app daveshirman$ ionic info

cli packages: (/Users/daveshirman/Documents/Work/AppHazard/apphazard-app/node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.7.1

System:

    ios-deploy : 1.9.2 
    ios-sim    : 5.0.8 
    Node       : v6.10.0
    npm        : 3.10.10 
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

Ok none of that worked. 好吧,没有一个工作。 So I did the only thing I could think of - I grabbed the android sdk folder from a time machine backup that the error was complaining about being missing, now it builds. 所以我做了我唯一能想到的事情 - 我从时间机器备份中抓取了android sdk文件夹,错误是抱怨丢失,现在它构建了。

I've probably got some sort of Frankenstein's monster dev setup now, but I don't care if the apps build and they work. 我现在可能已经安装了某种Frankenstein的怪物开发设备,但是我不关心应用程序是否构建并且它们有效。

What a mess Ionic dev has become, it's so sad. Ionic dev变得多么糟糕,令人伤心。

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

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