cannot resolve symbol GradleException问题
在Android Studio新建运行flutter项目没什么问题,但是在app下build.gradle文件中报“cannot resolve symbol gradleexception”的error。虽然不影响编译运行,但对于有强迫症的人看到这个红error就是心里有个梗……
各种搜索,各种尝试,升级Android Studio和Gradle插件都没办法消失,最后只能用stackoverflow中找到的一个解决办法点击原文地址
将GradleException换成FileNotFoundException,老代码:
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
新代码:
if (flutterRoot == null) {
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
保存重新运行就看不到红色的error了