Pub failed to delete entry because it was in use by another process. This may be caused by a virus scanner or having a file in the directory open in another application. pub finished with exit code 1
解决办法
管理员模式下启动IDE或CMD,然后执行Pub get等
3.2 Could not get unknown property 'ndkVersion'
现象
1
Could not get unknown property 'ndkVersion' for object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension
AndroidManifest.xml could not be found. Please check D:\Code\FlutterCode\FlutterScreens-master\android\AndroidManifest.xml for errors. No application found for TargetPlatform.android_x64. Is your project missing an android\AndroidManifest.xml? Consider running "flutter create ." to create one.
解决办法(打开终端执行如下指令)
1
flutter create .
3.4 "FlutterScreens-master" is not a valid Dart package name
现象
1 2 3
"FlutterScreens-master" is not a valid Dart package name.
See https://dart.dev/tools/pub/pubspec#name for more information.
解决办法
dart package name 必须全部小写命名,由数字、小写字母、下划线组成,对应的正则表达式为 [a-z0-9_]
3.5 pubspec.yaml has no lower-bound SDK constraint
现象
1 2 3 4 5
pubspec.yaml has no lower-bound SDK constraint. You should edit pubspec.yaml to contain an SDK constraint:
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You can try some of the following options: - changing the IDE settings. - changing the JAVA_HOME environment variable. - changing `org.gradle.java.home` in `gradle.properties`. Gradle settings
java.lang.NoClassDefFoundError: java/util/logging/Level at org.gradle.internal.logging.source.JavaUtilLoggingSystem.<clinit>(JavaUtilLoggingSystem.java:42) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:578) at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Caused by: java.lang.ClassNotFoundException: java.util.logging.Level at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 30 more
解决办法
jdk不完整,替换Android Studio下的jre
3.8 You need Java 11 or higher to build your app with this version of Gradle
现象
1 2 3 4 5 6 7 8
┌─ Flutter Fix ─────────────────────────────────────────────────────────────────┐ │ [!] You need Java 11 or higher to build your app with this version of Gradle. │ │ │ │ To get Java 11, update to the latest version of Android Studio on │ │ https://developer.android.com/studio/install. │ │ │ │ To check the Java version used by Flutter, run `flutter doctor -v`. │ └───────────────────────────────────────────────────────────────────────────────┘
解决办法
Android Studio下的jre为高版本jre(大于等于11)
3.9 RenderCustomMultiChildLayoutBox object was given an infinite size during layout
RenderCustomMultiChildLayoutBox object was given an infinite size during layout.
... parentData: not positioned; offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(0.0<=w<=392.7, 0.0<=h<=827.6) ... size: MISSING ... direction: vertical ... mainAxisAlignment: start ... mainAxisSize: max ... crossAxisAlignment: center ... verticalDirection: down The constraints that applied to the RenderCustomMultiChildLayoutBox were: BoxConstraints(0.0<=w<=392.7, 0.0<=h<=Infinity) The exact size it was given was: Size(392.7, Infinity)
See https://flutter.dev/docs/development/ui/layout/box-constraints for more information.
The relevant error-causing widget was: Scaffold Scaffold:file:///D:/Code/FlutterCode/flutter_zhihu_getX/lib/provider/refresh/refresh_paging_state_page.dart:80:12 When the exception was thrown, this was the stack: #0 RenderBox.debugAssertDoesMeetConstraints.<anonymous closure> (package:flutter/src/rendering/box.dart:2298:9) #1 RenderBox.debugAssertDoesMeetConstraints (package:flutter/src/rendering/box.dart:2394:6) #2 RenderBox.size=.<anonymous closure> (package:flutter/src/rendering/box.dart:2074:7) #3 RenderBox.size= (package:flutter/src/rendering/box.dart:2076:6) #4 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:409:5) #5 RenderObject.layout (package:flutter/src/rendering/object.dart:2189:7) #6 RenderBox.layout (package:flutter/src/rendering/box.dart:2430:11) #7 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:120:14)
RenderBox was not laid out: RenderViewport#2c443 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 2009 pos 12: 'hasSize'
3.14 We recommend using a newer Android Gradle plugin to...
现象
1 2 3 4 5 6 7 8 9 10
We recommend using a newer Android Gradle plugin to use compileSdk = 33
This Android Gradle plugin (7.2.0) was tested up to compileSdk = 32
This warning can be suppressed by adding android.suppressUnsupportedCompileSdk=33 to this project's gradle.properties
The build will continue, but you are strongly encouraged to update your project to use a newer Android Gradle Plugin that has been tested with compileSdk = 33
D:\Code\FlutterCode\wechat_flutter-master\.dart_tool\package_config.json does not exist. Did you run this command from the same directory as your pubspec.yaml file? Target gen_dart_plugin_registrant failed: Exception: