1.问题
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
造成该问题的原因是gradle插件版本(我的是4.1.3)和distributionUrl=*/gradle-7.0.2-all.zip这个地方的版本不一致导致的
解决方式
将android下build.gradle中的dependencies中修改为以下
classpath 'com.android.tools.build:gradle:7.0.0'
紧接着出现了第二个问题
FAILURE: Build failed with an exception.
* Where:
Build file '/opt/homebrew/Caskroom/flutter/2.2.3/flutter/.pub-cache/hosted/pub.flutter-io.cn/jverify-2.2.1/android/build.gradle' line: 26
* What went wrong:
A problem occurred evaluating project ':jverify'.
> No signature of method: build_7zl2566gv7mxy0ulm38137lif.android() is applicable for argument types: (build_7zl2566gv7mxy0ulm38137lif$_run_closure2) values: [build_7zl2566gv7mxy0ulm38137lif$_run_closure2@fd81999]
* Try:
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.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
Exception: Gradle task assembleDebug failed with exit code 1
解决方案 找到/opt/homebrew/Caskroom/flutter/2.2.3/flutter/.pub-cache/hosted/pub.flutter-io.cn/jverify-2.2.1/android/build.gradle 该文件所在地 执行以下方法
注释掉:useProguard true