打包时疏忽了一个重要的一点,进行打包时报了:
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APKto reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on:
https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... FAILURE: Build failed with an exception.
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... * What went wrong:
Running Gradle task 'assembleRelease'... Execution failed for task ':app:lintVitalRelease'.
Running Gradle task 'assembleRelease'... > Could not resolve all files for configuration ':app:lintClassPath'.
Running Gradle task 'assembleRelease'... > Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15)
Running Gradle task 'assembleRelease'... > Could not get resource 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.
Running Gradle task 'assembleRelease'... > Connection reset
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... * Try:
Running Gradle task 'assembleRelease'... Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... * Get more help at https://help.gradle.org
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... BUILD FAILED in 12m 18s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 738.9s (!)
Gradle task assembleRelease failed with exit code 1
很明显是网络不好(大家都懂得)
但是可以运行起来,签名配置签名,都干了,就最后打包时报了错,过了还才意识到,没尽兴镜像配置,我只全局进行了配置,只在构建第一个项目时进行了项目中的镜像配置,而我打包的是第三个项目,也就是说第二这和第三个都没进行镜像配置,所以才会网络出错,然后照着第一个flutter项目把第三个项目配置了一下,不一会就打包成功了
但是其实我在打包报错是还用了另一种方法,找个梯子,可惜这个梯子访问一些特别的网站还行,速度也挺快,对于flutter打包使用的外网还是不好使,幸好及时发现对镜像配置这一点的疏忽,不然还不知道要卡多久
内容来源于网络如有侵权请私信删除
文章来源: 博客园
- 还没有人评论,欢迎说说您的想法!