简体   繁体   中英

Ionic v1 Build Failed in android

I have an ionic v1 app, when I tried to produce apk using ionic cordova build android it failed to build the app.

错误味精

I already change the DistibutionURL on my .js file to 4.xx but every time I build the apps it detects that I have gradle 3.xx. Why is this?

You edited the correct file? It's not a js file.

ionic-project/platforms/android/gradle/wrapper/gradle-wrapper.properties

You will see

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

Change to

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

If this doesn't work try to install another cordova android platform:

cordova platform rm android

cordova platform add android@7.1.1

Or with 7.0.0 version, I recommend the 6.3.0 for legacy compatible.

The answer was to remove all installed platforms and delete plugin and platform folder. Re-add platform. Thanks to @Guillem Perez.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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