首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >kotlin-reflect 1.6.10.pom:2:1: prolog中不允许内容

kotlin-reflect 1.6.10.pom:2:1: prolog中不允许内容
EN

Stack Overflow用户
提问于 2022-07-12 20:39:12
回答 1查看 126关注 0票数 1

当我在Android中尝试在我的安卓手机上构建演示颤音应用程序的时候,或者当我不断地遇到这个错误时,和代码

代码语言:javascript
运行
复制
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Could not resolve all files for configuration ':app:kotlinCompilerClasspath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-script-runtime:1.6.10.
     Required by:
         project :app > org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.10
      > Could not resolve org.jetbrains.kotlin:kotlin-script-runtime:1.6.10.
         > Could not parse POM https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-script-runtime/1.6.10/kotlin-script-runtime-1.6.10.pom
            > Content is not allowed in prolog.
   > Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.6.10.
     Required by:
         project :app > org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.10
      > Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.6.10.
         > Could not parse POM https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-reflect/1.6.10/kotlin-reflect-1.6.10.pom
            > Content is not allowed in prolog.

如你所见,我的颤栗博士很好,1

gradle.build(app):下面我附上了我的build.gradle(应用程序),任何人都可以帮忙,因为我说我是新手,不知道Flutter.Thank是什么。

代码语言:javascript
运行
复制
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 flutter.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    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.example.flutter_application_1"
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    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"
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-12 20:57:10

根据安装的情况更改您的kotlin版本,并设置gradle插件匹配。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72958113

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档