- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已遵循此页面中的所有说明:https://flutter.dev/docs/get-started/install/windows
但是当我尝试运行“first_app”时出现错误:
Android Studio - run first_app
main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.display1,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
> Failed to transform artifact 'x86_debug.jar (io.flutter:x86_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c)' to match attributes {artifactType=android-classes, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: C:\Users\m-err\.gradle\caches\modules-2\files-2.1\io.flutter\x86_debug\1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c\e05f5680b1bbc2a38b625423c4ab890a526847cc\x86_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.jar.
> Failed to transform 'C:\Users\m-err\.gradle\caches\modules-2\files-2.1\io.flutter\x86_debug\1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c\e05f5680b1bbc2a38b625423c4ab890a526847cc\x86_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.jar' using Jetifier. Reason: invalid stored block lengths. (Run with --stacktrace for more details.)
> Failed to transform artifact 'x86_64_debug.jar (io.flutter:x86_64_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c)' to match attributes {artifactType=android-classes, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: C:\Users\m-err\.gradle\caches\modules-2\files-2.1\io.flutter\x86_64_debug\1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c\35b1d03b15670cc489efdcf317faf29bfd904402\x86_64_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.jar.
> Failed to transform 'C:\Users\m-err\.gradle\caches\modules-2\files-2.1\io.flutter\x86_64_debug\1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c\35b1d03b15670cc489efdcf317faf29bfd904402\x86_64_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.jar' using Jetifier. Reason: invalid stored block lengths. (Run with --stacktrace for more details.)
* 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
BUILD FAILED in 3s
Finished with error: Gradle task assembleDebug failed with exit code 1
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Versione 10.0.18362.720], locale it-IT)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
buildscript {
ext.kotlin_version = '1.3.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 29
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.first_app"
minSdkVersion 16
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
2020-04-01 15:38:00,597 [ 96871] INFO - rationStore.ComponentStoreImpl - Saving Project 'D:\Development\flutter\first_app' first_appKotlin2JvmCompilerArguments took 11 ms
2020-04-01 15:38:43,068 [ 139342] INFO - .flutter.run.daemon.FlutterApp - RunApp first_app (Run)
2020-04-01 15:38:43,068 [ 139342] INFO - .flutter.run.daemon.FlutterApp - D:\Programs\flutter\bin\flutter.bat [--no-color, run, --machine, --track-widget-creation, --device-id=emulator-5554, lib\main.dart]
2020-04-01 15:38:58,491 [ 154765] INFO - .FlutterAppDaemonEventListener - app shutdown took longer than 100ms
2020-04-01 15:38:58,516 [ 154790] INFO - .flutter.run.daemon.FlutterApp - StopApp first_app (Run)
2020-04-01 15:38:58,958 [ 155232] INFO - pl.ProjectRootManagerComponent - project roots have changed
2020-04-01 15:38:59,037 [ 155311] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 2ms; general responsiveness: ok; EDT responsiveness: ok
2020-04-01 15:38:59,073 [ 155347] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 36ms; general responsiveness: ok; EDT responsiveness: ok
2020-04-01 15:38:59,073 [ 155347] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 3 files to update
2020-04-01 15:38:59,112 [ 155386] INFO - .diagnostic.PerformanceWatcher - Unindexed files update took 39ms; general responsiveness: ok; EDT responsiveness: ok
2020-04-01 15:39:48,894 [ 205168] WARN - n.process.BaseOSProcessHandler - Process hasn't generated any output for a long time.
If it's a long-running mostly idle daemon process, consider overriding OSProcessHandler#readerOptions with 'BaseOutputReader.Options.forMostlySilentProcess()' to reduce CPU usage.
Command line: D:\Programs\Android\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_2_API_29
java.lang.Throwable: Process creation:
at com.intellij.execution.process.BaseOSProcessHandler.<init>(BaseOSProcessHandler.java:33)
at com.android.tools.idea.avdmanager.EmulatorProcessHandler.<init>(EmulatorProcessHandler.java:45)
at com.android.tools.idea.avdmanager.EmulatorRunner.start(EmulatorRunner.java:57)
at com.android.tools.idea.avdmanager.AvdManagerConnection.startAvd(AvdManagerConnection.java:419)
at com.android.tools.idea.avdmanager.AvdManagerConnection.startAvd(AvdManagerConnection.java:358)
at com.android.tools.idea.avdmanager.RunAvdAction.actionPerformed(RunAvdAction.java:36)
at com.android.tools.idea.avdmanager.AvdUiAction.hyperlinkUpdate(AvdUiAction.java:127)
at com.intellij.ui.HyperlinkLabel.fireHyperlinkEvent(HyperlinkLabel.java:218)
at com.intellij.ui.HyperlinkLabel.processMouseEvent(HyperlinkLabel.java:141)
at java.awt.Component.processEvent(Component.java:6315)
at java.awt.Container.processEvent(Container.java:2239)
at java.awt.Component.dispatchEventImpl(Component.java:4899)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Component.dispatchEvent(Component.java:4721)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4532)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.awt.Container.dispatchEventImpl(Container.java:2283)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4721)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:766)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:739)
at java.awt.EventQueue$4.run(EventQueue.java:737)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:736)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:878)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:823)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:466)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:465)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2020-04-01 15:58:25,798 [1322072] WARN - j.openapi.wm.impl.IdeFrameImpl - Set preferredFocusableComponent in 'Project' content in TODO tool window to avoid focus-related problems.
2020-04-01 15:58:25,799 [1322073] WARN - j.openapi.wm.impl.IdeFrameImpl - Project tool window - parent container is hidden
2020-04-01 15:58:45,410 [1341684] WARN - j.openapi.wm.impl.IdeFrameImpl - Set preferredFocusableComponent in '' content in Dart Analysis tool window to avoid focus-related problems.
2020-04-01 15:58:45,410 [1341684] WARN - j.openapi.wm.impl.IdeFrameImpl - tool window - parent container is hidden
2020-04-01 15:58:47,751 [1344025] WARN - j.openapi.wm.impl.IdeFrameImpl - Set preferredFocusableComponent in '' content in Logcat tool window to avoid focus-related problems.
2020-04-01 15:58:47,751 [1344025] WARN - j.openapi.wm.impl.IdeFrameImpl - tool window - parent container is hidden
2020-04-01 15:58:47,837 [1344111] INFO - AndroidLogcatToolWindowFactory - Successfully obtained debug bridge
2020-04-01 15:58:59,615 [1355889] INFO - m.pty4j.windows.WindowsVersion - Windows version: 10.0.18362
2020-04-01 15:59:04,985 [1361259] WARN - j.openapi.wm.impl.IdeFrameImpl - Set preferredFocusableComponent in 'Project' content in TODO tool window to avoid focus-related problems.
2020-04-01 15:59:04,986 [1361260] WARN - j.openapi.wm.impl.IdeFrameImpl - Project tool window - parent container is hidden
2020-04-01 15:59:05,402 [1361676] WARN - j.openapi.wm.impl.IdeFrameImpl - Set preferredFocusableComponent in 'main.dart' content in Run tool window to avoid focus-related problems.
2020-04-01 15:59:05,402 [1361676] WARN - j.openapi.wm.impl.IdeFrameImpl - main.dart tool window - parent container is hidden
2020-04-01 15:59:12,685 [1368959] WARN - com.intellij.util.xmlb.Binding - no accessors for class org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptInputsWatcher$Storage
2020-04-01 15:59:12,693 [1368967] WARN - com.intellij.util.xmlb.Binding - no accessors for class org.jetbrains.kotlin.idea.core.script.configuration.utils.ScriptClassRootsStorage
2020-04-01 15:59:13,373 [1369647] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 734 ms
2020-04-01 16:00:37,197 [1453471] INFO - .flutter.run.daemon.FlutterApp - RunApp first_app (Run)
2020-04-01 16:00:37,197 [1453471] INFO - .flutter.run.daemon.FlutterApp - D:\Programs\flutter\bin\flutter.bat [--no-color, run, --machine, --track-widget-creation, --device-id=emulator-5554, lib\main.dart]
2020-04-01 16:00:43,092 [1459366] INFO - .FlutterAppDaemonEventListener - app shutdown took longer than 100ms
2020-04-01 16:00:43,121 [1459395] INFO - .flutter.run.daemon.FlutterApp - StopApp first_app (Run)
最佳答案
我怀疑这是下载中断或转换中断的结果,因为错误消息 invalid stored block lengths
清楚地提示损坏的 ZIP/JAR 文件。尝试清空目录C:\Users\m-err\.gradle\caches
然后重建应用程序。
并且不要禁用 Lint 检查,这样它会提示最终无效的包:
lintOptions {
// disable 'InvalidPackage'
}
androidx
依赖项,您不需要使用 Jetifier。
关于android-studio - Android Studio - 任务 ':app:compileDebugKotlin' 执行失败 - 无法转换工件 'x86_debug.jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60972827/
失败:构建失败,出现异常。 出了什么问题:任务“:react-native-screens:compileDebugKotlin”执行失败。 Error while evaluating proper
更新到 Dart 3.0 后,当我在 Android 模拟器上启动应用程序时出现此错误。 对于 iOS 物理设备,它的构建还可以。不幸的是,无法尝试使用 Android 物理设备。有任何想法吗? e:
尝试将我的 Flutter 应用程序编译到 Android 模拟器时,我遇到了这个令人讨厌的错误。这是错误日志(太长,无法完全粘贴): aunching lib/main.dart on sdk gp
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我尝试安装 audioplayers: ^0.17.1并运行我的 flutter 项目。它引发以下错误。有人可以帮忙吗? e: C:\Users\User\flutter\.pub-cache\hos
我尝试使用 gradle-plugin 在 Jenkins 中构建我的 apk,但由于 Internal compiler error 该项目是用Kotlin编写的 在 Jenkins 中,我在 sv
我最近更新了我的 kotlin 和 kotlin 扩展插件,并且在构建时出现以下错误。我尝试使用 gradle 清理构建或同步项目,但没有任何效果 e: Supertypes of the follo
我正在做一个旧项目。它在 5 天前运行良好。现在我正面临agora 的错误。我之前的代码没有任何改变。 这是错误- FAILURE: Build failed with an exception. *
任务':location:compileDebugKotlin'执行失败。 build:gradle(模块:app) ext.kotlin_version = '1.6.10' rep
Kotlin Gradle 插件在不同的子项目中多次加载,不受支持并且可能会破坏构建。 这可能发生在应用带有 Gradle 'plugins { ... }' DSL 的 Kotlin 插件的子项目中
我正在开发一个 React Native 应用程序,其中包含了一些 expo 库(裸工作流)。我已经成功使用了expo-location ,但现在我也安装了expo-camera ,应用程序将不再使用
我尝试从 运行默认的 flutter 应用程序 flutter 创建 在我的 android 设备上,但它给我一个错误。有人可以帮忙吗? Launching lib\main.dart on SM G
更新完我的flutter工程,准备在android studio中运行应用,出现如下错误。 e: C:\Users\user\AppData\Local\Pub\Cache\hosted\pub.da
我不知道我是如何陷入这个困境的,但我认为问题出在Java二进制路径上......来自flutter doctor的路径与异常中的路径不同。当我运行现有项目或创建新项目并尝试运行它时,它仍然会给出相同的
我已将 Android Studio 更新为 3.3,现在我无法构建现有项目之一,我尝试过无效/重启,还检查了 gradle -wrapper.properties其中gradle版本是最新更新: d
Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more det
我已遵循此页面中的所有说明:https://flutter.dev/docs/get-started/install/windows 但是当我尝试运行“first_app”时出现错误: Android
注意:某些输入文件使用或覆盖已弃用的 API。注意:使用 -Xlint:deprecation 重新编译以获取详细信息。注意:某些输入文件使用未经检查或不安全的操作。注意:使用 -Xlint:unch
注意:某些输入文件使用或覆盖已弃用的 API。注意:使用 -Xlint:deprecation 重新编译以获取详细信息。注意:某些输入文件使用未经检查或不安全的操作。注意:使用 -Xlint:unch
我正在将我的 Android 项目从 Java 转换为 Kotlin。我已经和其他 3 个项目成功地完成了这个过程。 但是这个有点大,结构复杂。我已将一些文件转换为 Kotlin 并进行项目编译。但是
我是一名优秀的程序员,十分优秀!