Flutter配置问题

折月煮酒 提交于 2020-02-12 14:50:48

Flutter配置问题

配置阿里云仓库

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!