Ionic Android build: java.lang.IllegalStateException: buildToolsVersion is not specified

后端 未结 4 1573
醉酒成梦
醉酒成梦 2021-02-19 02:23

Since today, somehow my ionic project is not longer able to build for some reason. I already tried to remove the platform and add it again, but it didn\'t work. I now almost spe

相关标签:
4条回答
  • 2021-02-19 03:06

    I was facing this issue. The problem was that my ANDROID_HOME path was pointing to Android Studio's folder. I changed it to point to my Android SDK Folder and problem was solved.

    1. Check your ANDROID_HOME:

    echo $ANDROID_HOME

    1. It should point to the Android SDK Folder:

    export ANDROID_HOME="your-android-sdk-folder"

    0 讨论(0)
  • 2021-02-19 03:21

    I figured it out, the problem was due to a misconfigured config.xml entry:

    <widget xmlns="http://www.w3.org/ns/widgets"
            xmlns:cdv="http://cordova.apache.org/ns/1.0"
            id="ch.papers.test"
            version="1.0.{BUILD_NUMBER}"
            android-versionCode="{BUILD_NUMBER}">...
    

    Which we use for our Jenkins configuration. Unfortunately the error message was quite confusing.

    Update corrected version:

    <widget xmlns="http://www.w3.org/ns/widgets"
            xmlns:cdv="http://cordova.apache.org/ns/1.0"
            id="ch.papers.test"
            version="1.0.0"
            android-versionCode="1">...
    
    0 讨论(0)
  • 2021-02-19 03:22

    I had the same issue. I fixed it as follows:-

    Open Android studio configuration.

    Go to config>SDK Manager>Android SDK>SDK Tools and install Android SDK Build-Tools.

    Check the ANDROID_HOME variable. I am on mac, so it points to "/Users/user_name/Library/Android/sdk/"

    If not set correctly set it as follows:-

    export ANDROID_HOME="/Users/user_name/Library/Android/sdk/"

    Now build it again and it should work fine.

    PS:Getting android sdk by installing Android Studio is highly recommended than installing the sdk manually. This way you will not run into unnecessary trouble.

    0 讨论(0)
  • 2021-02-19 03:26

    I solved this issue by saving the build.gradle and/or the build-extras.gradle with Unix (LF) line endings.. Your android-versionCode should have nothing to do with the buildversion of your android sdk...

    0 讨论(0)
提交回复
热议问题