Flutter: Failed to notify project evalution listener

简介: 又是一个常见的flutter的环境问题,一般发生在引用了plugin之后。因为默认的gradle,kotlin之类的比较旧,而所引用的plugin里面的gradle,kotlin比较新。所以会有这个问题,如图: 解决方式也是很简单,一顿升级gradle,gradle wrapper和kotlin。

又是一个常见的flutter的环境问题,一般发生在引用了plugin之后。因为默认的gradle,kotlin之类的比较旧,而所引用的plugin里面的gradle,kotlin比较新。所以会有这个问题,如图:

457973DC7C5759AC9878F11442EBDBAB.png
解决方式也是很简单,一顿升级gradle,gradle wrapper和kotlin。
仅以android studio为例:
首先,右键你的flutter项目,选择Flutter->Open Android Module in Android Studio。
image.png
如上图,有几个build.gradle文件,依次打开找到如下代码(如果有的话):

buildscript {
    ext.kotlin_version = '1.2.30'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

ext.kotlin_version = '1.2.30'换成 ext.kotlin_version = '1.2.71',把 classpath 'com.android.tools.build:gradle:3.1.0'换成 classpath 'com.android.tools.build:gradle:3.2.1'
再打开gradle-wrapper.properties,如下:

#Wed Oct 10 15:20:17 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip换成distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
至此问题解决。
有的朋友打包里还可能会遇到下面的问题:

Unable to resolve dependency for ':app@dynamicProfile/compileClasspath': Could not resolve project :fluwx.
Open File
Show Details


Unable to resolve dependency for ':app@dynamicProfile/compileClasspath': Could not resolve project :sona.
Open File
Show Details


Unable to resolve dependency for ':app@dynamicProfileUnitTest/compileClasspath': Could not resolve project :fluwx.
Open File
Show Details

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip换成distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip就解决了。

目录
相关文章
|
7月前
|
Java 网络安全 Maven
简记:一个flutter构建错误A problem occurred configuring project ‘:smart_auth‘. > Could not res
简记:一个flutter构建错误A problem occurred configuring project ‘:smart_auth‘. > Could not res
432 0
|
4月前
|
Dart Android开发
Android Studio New里面没有New Flutter Project
Android Studio New里面没有New Flutter Project
164 1
Android Studio New里面没有New Flutter Project
|
4月前
|
缓存 iOS开发
Flutter run出现No Provisioning Profile was found for your project‘s Bundle Identifier or your device
Flutter run出现No Provisioning Profile was found for your project‘s Bundle Identifier or your device
61 2
|
7月前
|
机器学习/深度学习 Java Android开发
记录一个Flutter运行的异常FAILURE: Build failed with an exception. What went wrong: A problem occurred config
记录一个Flutter运行的异常FAILURE: Build failed with an exception. What went wrong: A problem occurred config
241 0
【交互 widget】Flutter Listener
【交互 widget】Flutter Listener
199 0
【交互 widget】Flutter Listener
首次运行Flutter失败报错(Finished with error: Gradle task assembleDebug failed with exit code 1)
首次运行Flutter失败报错(Finished with error: Gradle task assembleDebug failed with exit code 1)
489 0
首次运行Flutter失败报错(Finished with error: Gradle task assembleDebug failed with exit code 1)
|
开发工具 Android开发
Flutter build failed android:AAPT2 aapt2-3.2.1-4818971-osx
Flutter build failed android:AAPT2 aapt2-3.2.1-4818971-osx
182 0
Flutter build failed android:AAPT2 aapt2-3.2.1-4818971-osx
|
Dart
【错误记录】发布 Flutter 插件包报错 ( Failed to upload the package.pub finished with exit code 1 )
【错误记录】发布 Flutter 插件包报错 ( Failed to upload the package.pub finished with exit code 1 )
514 0
【错误记录】发布 Flutter 插件包报错 ( Failed to upload the package.pub finished with exit code 1 )
|
Web App开发
Flutter web问题:Failed to load network image
我的解决办法: flutter build web --release --web-renderer html flutter run --web-renderer html flutter run -d chrome --web-renderer html
339 0
Flutter web问题:Failed to load network image
|
Dart 开发工具 Android开发
【错误记录】Flutter 报错 Downloading the Dart SDK using the BITS service failed, retrying with WebRequest...
【错误记录】Flutter 报错 Downloading the Dart SDK using the BITS service failed, retrying with WebRequest...
566 0
【错误记录】Flutter 报错 Downloading the Dart SDK using the BITS service failed, retrying with WebRequest...