出现了一个问题,即配置项目':wakelock'在颤抖中
因此,我一直在试图运行我的Flutter应用程序,但是我会在错误时遇到错误。当我跑步运行时,这就是我得到的
Launching lib\main.dart on M2102J20SG in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':wakelock'.
> Could not resolve all artifacts for configuration ':wakelock:classpath'.
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31.
Required by:
project :wakelock
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.31/kotlin-gradle-plugin-1.5.31.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.31/kotlin-gradle-plugin-1.5.31.pom'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.60.215] failed: Connection timed out: connect
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for project ':wakelock' of type org.gradle.api.Project.
> Could not get unknown property 'android' for project ':wakelock' of type org.gradle.api.Project.
* 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 21m 48s
Running Gradle task 'assembleDebug'... 1323.8s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':wakelock'.
> Could not resolve all artifacts for configuration ':wakelock:classpath'.
> Could not download kotlin-compiler-embeddable-1.5.31.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.5.31)
> Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.5.31/kotlin-compiler-embeddable-1.5.31.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.5.31/kotlin-compiler-embeddable-1.5.31.jar'.
> Remote host terminated the handshake
> Could not download kotlin-scripting-jvm-1.5.31.jar (org.jetbrains.kotlin:kotlin-scripting-jvm:1.5.31)
> Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-scripting-jvm/1.5.31/kotlin-scripting-jvm-1.5.31.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-scripting-jvm/1.5.31/kotlin-scripting-jvm-1.5.31.jar'.
> Remote host terminated the handshake
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for project ':wakelock' of type org.gradle.api.Project.
> Could not get unknown property 'android' for project ':wakelock' of type org.gradle.api.Project.
* 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 2m 34s
Running Gradle task 'assembleDebug'... 164.8s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
是我的build.gradle
文件,
ext.kotlin_version = '1.6.0'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.5'
}
}
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
}
这是我的android/app/build.gradle.gradle
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"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 31
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.murya.marveldcnews"
minSdkVersion 21
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
我尝试删除Gradle Caches,升级的颤音,我已经更改了密钥库文件位置上的后斜线以向前砍下,
这是我的flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19043.1645], locale en-NG)
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.66.2)
[√] Connected device (4 available)
[√] HTTP Host Availability
! Doctor found issues in 1 category.
我没有为Windows开发,所以我认为这不是必需的...
So I have been trying to run my flutter app but I keep getting errors upon errors. When I ran flutter run, this is what I got
Launching lib\main.dart on M2102J20SG in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':wakelock'.
> Could not resolve all artifacts for configuration ':wakelock:classpath'.
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31.
Required by:
project :wakelock
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.31/kotlin-gradle-plugin-1.5.31.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.31/kotlin-gradle-plugin-1.5.31.pom'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.60.215] failed: Connection timed out: connect
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for project ':wakelock' of type org.gradle.api.Project.
> Could not get unknown property 'android' for project ':wakelock' of type org.gradle.api.Project.
* 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 21m 48s
Running Gradle task 'assembleDebug'... 1323.8s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':wakelock'.
> Could not resolve all artifacts for configuration ':wakelock:classpath'.
> Could not download kotlin-compiler-embeddable-1.5.31.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.5.31)
> Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.5.31/kotlin-compiler-embeddable-1.5.31.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.5.31/kotlin-compiler-embeddable-1.5.31.jar'.
> Remote host terminated the handshake
> Could not download kotlin-scripting-jvm-1.5.31.jar (org.jetbrains.kotlin:kotlin-scripting-jvm:1.5.31)
> Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-scripting-jvm/1.5.31/kotlin-scripting-jvm-1.5.31.jar'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-scripting-jvm/1.5.31/kotlin-scripting-jvm-1.5.31.jar'.
> Remote host terminated the handshake
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for project ':wakelock' of type org.gradle.api.Project.
> Could not get unknown property 'android' for project ':wakelock' of type org.gradle.api.Project.
* 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 2m 34s
Running Gradle task 'assembleDebug'... 164.8s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
This is my build.gradle
file
ext.kotlin_version = '1.6.0'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.5'
}
}
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
}
This is my android/app/build.gradle
file
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"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 31
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.murya.marveldcnews"
minSdkVersion 21
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
I have tried deleting gradle caches, upgraded flutter, I have changed the backslashes on my keystore file location to forward slashes
This is my flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19043.1645], locale en-NG)
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.66.2)
[√] Connected device (4 available)
[√] HTTP Host Availability
! Doctor found issues in 1 category.
I'm not developing for windows, so I assume that's not necessary...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否使用
flutter_html
。如果您正在使用,Flutter_HTML 2.1.2
取决于Wakelock 0.4.0
不支持Kotlin 1.5
Do you use
flutter_html
. If you are using,flutter_html 2.1.2
depends uponwakelock 0.4.0
which doesn't supportKotlin 1.5