阅读 441

FunFlutter 系列之疑难杂症①

收集开发中遇到的问题

xxx.dart were declared as an inputs, but did not exist

编译时出现

xxx/xxx.dart were declared as an inputs, but did not exist. Check the definition of target:kernel_snapshot for errors

因为自己在两个分支切换,分支2比分支1多了几个文件如(xxx.dart),当切回到分支1编译的时候,编译失败并提示xxx.dart were declared as an input ,but id not exist,第一反应是缓存删除build目录,没有效果.

最后发现删除IDE的.dart_tool文件夹即可.或者直接命令行运行flutter clean


Gradle build failed to produce an Android package.

build.gradle中修改了Android APK的文件名 就会出现以下的错误:

Finished with error: Gradle build failed to produce an Android package


Could not find the built application bundle at build/ios/iphonesimulator/Runner.app

在xcode11的版本中,在General里修改了Display Name,如果通过Android Studio或VS Code运行的时候会出现以上的错误.是因为运行时查找的是Runner.app而编译生成的是你修改过后的名字.

解决方案:

还原GeneralDisplay NameRunner.app;然后在info也就是plist中 修改Bundle display name为你想修改的文件名;然后通过AS或者VS运行一下;这时候当我在xcode切回到Generaltab里,会发现Display Name已经修改为你要改的名字.


ProcessException: Process "xxx/xxx/android/gradlew" exited abnormally

一般会发生在VsCode中,本地Gradle版本不一致导致的问题 详情可以看这个 issue29的第二条comment

关注下面的标签,发现更多相似文章
评论