Flutter配置问题
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
X Android SDK file not found: D:\AndroidSDK\build-tools\29.0.3\aapt.
解决方式:
分别更新SDK Platforms和SDK Tools下对应的sdk 版本
Android toolchain - develop for Android devices (Android SDK version 29.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
解决方式:执行命令
flutter doctor --android-licenses
一路按Y
配置阿里云仓库
project 的build.gradle
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
/* google()
jcenter()*/
maven{ url 'https://maven.aliyun.com/repository/google'}
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
/* google()
jcenter()*/
maven{ url 'https://maven.aliyun.com/repository/google'}
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
}
}
flutter\packages\flutter_tools\gradle\flutter.gradle
buildscript {
repositories {
//google()
//jcenter()
maven{ url 'https://maven.aliyun.com/repository/google'}
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}
Exception in thread “main” javax.net.ssl.SSLHandshakeException:
Launching lib\main.dart on ELE AL00 in debug mode...
Running Gradle task 'assembleDebug'... /
Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderE
xception: unable to find valid certification path to requested target
遇到这个问题,百查不得其解,“无法找到被请求目标的有效认证路径”,缺少所访网站的证书
assembleDebug编译需要访问网络,然后我就尝试替换 阿里云仓库,配置gradle版本…
flutter项目中的android部分能跑了,但是flutter还不能跑,尝试了一下这个
https://blog.csdn.net/tiger_feng1/article/details/82811373设置了本机的ip地址,gradle竟然通过了
然后又会衍生其他问题,算了,重新创建flutter项目,重新创建的项目竟然没报错…
':app:lintVitalRelease
Execution failed for task ‘:app:lintVitalRelease’.
Could not resolve all files for configuration ‘:app:lintClassPath’.
解决:
在app的build.gradle添加
lintOptions {
checkReleaseBuilds false
abortOnError false
}
关于flutter中android部分能运行,flutter运行couldn’t find “libflutter.so”
bortOnError false
}
#### 关于flutter中android部分能运行,flutter运行couldn't find "libflutter.so"
解决:把android部分中的.gradle删除,重新运行flutter项目
参考:https://www.cnblogs.com/joahyau/p/11487652.html