从VScode运行时,我的flutter应用程序始终停留在运行grade任务汇编错误
当我在命令提示符下运行flutterrun-v时,它可以工作,但不能从VSCode运行。这个问题似乎从上周就开始了。已尝试/gradlew清洁和/gradlew干净的构建,这有时会起作用,并从vscode构建
删除并创建了一个新的仿真设备,也尝试了许多在线建议
颤振医生的输出 -v
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19044.1415], locale en-US)
• Flutter version 2.8.1 at E:\Flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (4 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at E:\sdk\Android
• Platform android-31, build-tools 30.0.2
• ANDROID_SDK_ROOT = E:\sdk\Android
• Java binary at: F:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 2020.3)
• Android Studio at F:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] Connected device (3 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 97.0.4692.71
• Edge (web) • edge • web-javascript • Microsoft Edge 96.0.1054.62
• No issues found!
创建了一个全新的flutter项目并进行gradlew清理,并收到了gradlew清理--ward-mode all的以下消息
> Configure project :app
Adding a Configuration as a dependency is a confusing behavior which isn't recommended. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. If you're interested in inheriting the dependencies from the Configuration you are adding, you should use Configuration#extendsFrom instead. See https://docs.gradle.org/6.7/dsl/org.gradle.api.artifacts.Configuration.html#org.gradle.api.artifacts.Configuration:extendsFrom(org.gradle.api.artifacts.Configuration[]) for more details.
at build_59yj46qtreisbbowxqfuhj29p$_run_closure3.doCall(D:\MobileDevelopment\GitRepo\jigsaw\android\build.gradle:26)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
The AbstractArchiveTask.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the destinationDirectory property instead. See https://docs.gradle.org/6.7/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:destinationDir for more details.
at FlutterPlugin$_addFlutterTasks_closure20$_closure44.doCall(E:\Flutter\packages\flutter_tools\gradle\flutter.gradle:833)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
The AbstractArchiveTask.archiveName property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the archiveFileName property instead. See https://docs.gradle.org/6.7/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:archiveName for more details.
at FlutterPlugin$_addFlutterTasks_closure20$_closure44.doCall(E:\Flutter\packages\flutter_tools\gradle\flutter.gradle:834)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
BUILD SUCCESSFUL in 2s
2 actionable tasks: 2 up-to-date
运行gradlew build会给出
> Task :app:stripDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libflutter.so.
> Task :app:stripProfileDebugSymbols
Unable to strip the following libraries, packaging them as they are: libapp.so, libflutter.so, libvmservice_snapshot.so
> Task :app:lint FAILED
Ran lint on variant debug: 3 issues found
Ran lint on variant release: 3 issues found
Ran lint on variant profile: 3 issues found
Wrote HTML report to file:///D:/MobileDevelopment/GitRepo/jigsaw/build/app/reports/lint-results.html
Wrote XML report to file:///D:/MobileDevelopment/GitRepo/jigsaw/build/app/reports/lint-results.xml
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lint'.
> Lint found errors in the project; aborting build.
Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
lintOptions {
abortOnError false
}
}
...
Errors found:
D:\MobileDevelopment\GitRepo\jigsaw\android\app\src\main\AndroidManifest.xml:5: Error: Class referenced in the manifest, com.example.jigsaw.${applicationName}, was not found in the project or the libraries [MissingClass]
android:name="${applicationName}"
~~~~~~~~~~~~~~~~~~
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2m 26s
94 actionable tasks: 90 executed, 4 up-to-date
从谷歌官方文档重新下载了flutter 2.8 sdk,其中也有dart并重试。
我确实通过首先执行
颤振清理
然后,为了重新编译项目daet文件
颤振酒吧升级
这是由于您的gradle正在下载其版本,但有时下载速度太低,无法下载,您可以修复它:
首先在项目的根目录中检查您的等级版本:
<project name> > android > gradle > wrapper > gradle-wrapper.properties
检查distributionUrl,您将看到项目中使用的是哪个gradle版本,并且正在下载,因此您应该在该链接中下载该版本https://services.gradle.org/distributions/
下载后,复制并转到以下目录:
C:\Users\<user name>\.gradle\wrapper\dists\gradle <your version>\<a file with weird name>\
在此处粘贴和解压缩您下载的文件。
每次我也希望你能对我有用。如果有任何问题,请告诉我。
我在跑Pop_OS!20.10 [✓] Flutter(Channel stable,1.22.3,Linux,locale en_US.UTF-8)•Flutter版本1.22.3 at/home/samdc/DevTools/Flutter•框架版本8874f21(3个月前),2020-10-29 14:14:35-0700•引擎版本a1440ca392•Dart版本2.10.3•Pub下载镜
当我运行应用程序时,它卡住了 它永远不会初始化Gradle或依赖项
嗨,我得到了这个错误,当我试图运行反应应用程序在我真正的Android设备上通过:
是否可以在gradle.properties文件中定义test.maxParallelForks=runtime.runtime.availableProcessors(),而不是在test任务下的每个build.gradle文件中定义它?
我的gradle项目中有一个java主程序,我可以通过命令行使用gradle应用程序插件运行任务--args param new从gradle 4.9开始运行,如下所示: 我想在IntelliJ IDEA CE 2018.1中为同样的配置创建一个运行配置。 我在Run/Debug配置dilog中将任务字段指定为 当我运行这个运行配置时,我得到一个错误: 如何通过运行配置使此工作?
错误:任务“:app:processDebugManifest”的执行失败。 清单合并失败:属性元数据#android。支持VERSION@value值=(25.3.1)来自[com.android.support:appcompat-v7:25.3.1]AndroidManifest。xml:27:9-31也出现在[com.android.support:recyclerview-v7:26.0
任务:应用程序:安装调试失败31个可操作的任务:31个已执行注意:C:\用户\Bst 305\ReactNativeDsr\android\app\src\debug\java\com\reactnativedsr\ReactNativeFlipper.java使用或覆盖已弃用的API。注意:使用-Xlint重新编译:有关详细信息的弃用。 失败:构建失败,但有一个异常。 错误:任务:app:ins
运行Gradle时出错: 失败:生成失败,出现异常。 错误:配置根项目“android”时出现问题。 尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。 在https://help.gradle.org获得更多帮助 构建在27秒内失败 完成时出现错误:请查看android/文件夹中的Gradle项目设置。