Android Studio:将 Kotlin 添加到现有 Java 应用程序最终会在构建时出现“内部错误:意外的 lint 返回值 -1”

问题描述 投票:0回答:3

我正在将 Kotlin 添加到我现有的 Java 应用程序中(我首先必须说我已经在我的另一个应用程序中完成了这一操作,完全没有任何问题),并且在执行所有必需的初始步骤之后,我总是收到“内部错误:意外” lint 返回值 -1”,构建时没有错误详细信息。

这是我的项目成绩文件的相关部分:

buildscript {
    ext.kotlin_version = '1.7.0'
    repositories {
        jcenter()
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
...
}

这是我的模块构建.gradle的相关部分:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
  ...
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

我已尝试了此处找到的所有建议:How to Use Kotlin in an Existing Android App? 无济于事。

我还尝试使用以下方法清除所有缓存:

rm -rf ~/.gradle/caches/

也无济于事。

我能做什么?我什至没有得到有关该问题的详细信息。

编辑1:

现在我可以看到完整的构建日志了:

Executing tasks: [:DTO:clean, :Core:clean, :Repository:clean, :app:clean, :Security:clean, :Services:clean, :Global:clean, :Background:clean, :Common:clean, :Exception:clean, :Core:assembleDebug, :DTO:assembleDebug, :Repository:assembleDebug, :Global:assembleDebug, :app:assembleDebug, :Security:assembleDebug, :Services:assembleDebug, :Exception:assembleDebug, :Background:assembleDebug, :Common:assembleDebug] in project /Users/JohnDoe/StudioProjects/android_myapp

Starting Gradle Daemon...
Gradle Daemon started in 493 ms

> Configure project :
The RepositoryHandler.jcenter() method has been deprecated. This is scheduled to be removed in Gradle 8.0. JFrog announced JCenter's sunset in February 2021. Use mavenCentral() instead. Consult the upgrading guide for further information: https://docs.gradle.org/7.3.3/userguide/upgrading_version_6.html#jcenter_deprecation
    at build_e2801rmseiq7s1of4dy7020et$_run_closure1$_closure2.doCall(/Users/JohnDoe/StudioProjects/android_myapp/build.gradle:5)
    (Run with --stacktrace to get the full stack trace of this deprecation warning.)

> Task :DTO:clean
> Task :Core:clean
> Task :Repository:clean
> Task :app:clean
> Task :Security:clean
> Task :Services:clean
> Task :Global:clean
> Task :Background:clean
> Task :Common:clean
> Task :Exception:clean
> Task :Core:preBuild UP-TO-DATE
> Task :Core:preDebugBuild UP-TO-DATE
> Task :Core:compileDebugAidl NO-SOURCE
> Task :Core:mergeDebugJniLibFolders
> Task :Core:mergeDebugNativeLibs NO-SOURCE
> Task :Core:stripDebugDebugSymbols NO-SOURCE
> Task :Core:compileDebugRenderscript NO-SOURCE
> Task :Core:copyDebugJniLibsProjectAndLocalJars
> Task :Core:generateDebugBuildConfig
> Task :Core:generateDebugResValues
> Task :Core:generateDebugResources
> Task :Core:packageDebugResources
> Task :Core:javaPreCompileDebug
> Task :Core:mergeDebugShaders
> Task :Core:compileDebugShaders NO-SOURCE
> Task :Core:generateDebugAssets UP-TO-DATE
> Task :Core:packageDebugAssets
> Task :Core:packageDebugRenderscript NO-SOURCE
> Task :Core:prepareDebugArtProfile UP-TO-DATE
> Task :Core:prepareLintJarForPublish UP-TO-DATE
> Task :Core:parseDebugLocalResources
> Task :Core:processDebugJavaRes NO-SOURCE
> Task :DTO:preBuild UP-TO-DATE
> Task :DTO:preDebugBuild UP-TO-DATE
> Task :Core:writeDebugAarMetadata
> Task :DTO:compileDebugAidl NO-SOURCE
> Task :DTO:mergeDebugJniLibFolders
> Task :DTO:mergeDebugNativeLibs NO-SOURCE
> Task :DTO:stripDebugDebugSymbols NO-SOURCE
> Task :DTO:copyDebugJniLibsProjectAndLocalJars
> Task :DTO:compileDebugRenderscript NO-SOURCE
> Task :DTO:generateDebugBuildConfig
> Task :DTO:generateDebugResValues
> Task :DTO:generateDebugResources
> Task :Core:processDebugManifest
> Task :DTO:packageDebugResources
> Task :DTO:parseDebugLocalResources
> Task :DTO:processDebugManifest
> Task :DTO:javaPreCompileDebug
> Task :DTO:mergeDebugShaders
> Task :DTO:compileDebugShaders NO-SOURCE
> Task :DTO:generateDebugAssets UP-TO-DATE
> Task :DTO:packageDebugAssets
> Task :DTO:packageDebugRenderscript NO-SOURCE
> Task :DTO:prepareDebugArtProfile UP-TO-DATE
> Task :DTO:prepareLintJarForPublish UP-TO-DATE
> Task :DTO:processDebugJavaRes NO-SOURCE
> Task :Common:preBuild UP-TO-DATE
> Task :Common:preDebugBuild UP-TO-DATE
> Task :Global:preBuild UP-TO-DATE
> Task :Global:preDebugBuild UP-TO-DATE
> Task :DTO:writeDebugAarMetadata
> Task :Global:compileDebugAidl NO-SOURCE
> Task :Common:compileDebugAidl NO-SOURCE
> Task :Repository:preBuild UP-TO-DATE
> Task :Repository:preDebugBuild UP-TO-DATE
> Task :Repository:compileDebugAidl NO-SOURCE
> Task :Repository:mergeDebugJniLibFolders
> Task :Repository:mergeDebugNativeLibs NO-SOURCE
> Task :Repository:stripDebugDebugSymbols NO-SOURCE
> Task :Repository:copyDebugJniLibsProjectAndLocalJars
> Task :Global:packageDebugRenderscript NO-SOURCE
> Task :Common:compileDebugRenderscript NO-SOURCE
> Task :Common:generateDebugBuildConfig
> Task :Common:generateDebugResValues
> Task :Common:generateDebugResources
> Task :Common:packageDebugResources
> Task :Common:parseDebugLocalResources
> Task :Global:compileDebugRenderscript NO-SOURCE
> Task :Core:generateDebugRFile
> Task :Global:generateDebugResValues
> Task :Global:generateDebugResources
> Task :Common:processDebugManifest
> Task :Global:packageDebugResources
> Task :Global:parseDebugLocalResources
> Task :Global:generateDebugBuildConfig
> Task :Global:javaPreCompileDebug
> Task :Global:processDebugManifest
> Task :Common:javaPreCompileDebug
> Task :Common:packageDebugRenderscript NO-SOURCE
> Task :Repository:compileDebugRenderscript NO-SOURCE
> Task :Repository:generateDebugBuildConfig
> Task :Repository:generateDebugResValues
> Task :Repository:generateDebugResources
> Task :Repository:packageDebugResources
> Task :Repository:parseDebugLocalResources
> Task :Core:compileDebugKotlin NO-SOURCE
> Task :Repository:processDebugManifest

> Task :Core:extractDebugAnnotations FAILED
/Users/JohnDoe/StudioProjects/android_myapp/Core/build/tmp/kotlin-classes/debug does not exist

> Task :Core:compileDebugJavaWithJavac
> Task :Core:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :Core:mergeDebugConsumerProguardFiles
> Task :Core:bundleLibCompileToJarDebug
> Task :Repository:javaPreCompileDebug
> Task :DTO:generateDebugRFile
> Task :Repository:mergeDebugShaders
> Task :Repository:compileDebugShaders NO-SOURCE
> Task :Repository:generateDebugAssets UP-TO-DATE
> Task :Repository:packageDebugAssets
> Task :Repository:packageDebugRenderscript NO-SOURCE
> Task :Repository:prepareDebugArtProfile UP-TO-DATE
> Task :Repository:prepareLintJarForPublish UP-TO-DATE
> Task :Repository:processDebugJavaRes NO-SOURCE
> Task :Repository:writeDebugAarMetadata
> Task :Core:mergeDebugJavaResource
> Task :Global:mergeDebugJniLibFolders
> Task :Global:mergeDebugNativeLibs NO-SOURCE
> Task :Global:stripDebugDebugSymbols NO-SOURCE
> Task :Global:copyDebugJniLibsProjectAndLocalJars
> Task :Global:mergeDebugShaders
> Task :Global:compileDebugShaders NO-SOURCE
> Task :Global:generateDebugAssets UP-TO-DATE
> Task :Global:packageDebugAssets
> Task :Global:prepareDebugArtProfile UP-TO-DATE
> Task :Global:prepareLintJarForPublish UP-TO-DATE
> Task :Global:processDebugJavaRes NO-SOURCE
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :Global:writeDebugAarMetadata
> Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :Background:preBuild UP-TO-DATE
> Task :Background:preDebugBuild UP-TO-DATE
> Task :Services:preBuild UP-TO-DATE
> Task :Services:preDebugBuild UP-TO-DATE
> Task :Services:compileDebugAidl NO-SOURCE
> Task :Background:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :Background:packageDebugRenderscript NO-SOURCE
> Task :Services:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:dataBindingMergeDependencyArtifactsDebug
> Task :app:generateDebugResValues
> Task :app:generateDebugResources
> Task :app:dataBindingMergeGenClassesDebug
> Task :Background:compileDebugRenderscript NO-SOURCE
> Task :Background:generateDebugResValues
> Task :Background:generateDebugResources
> Task :Background:packageDebugResources
> Task :Services:compileDebugRenderscript NO-SOURCE
> Task :Services:generateDebugResValues
> Task :Services:generateDebugResources
> Task :Services:packageDebugResources
> Task :DTO:compileDebugKotlin NO-SOURCE
> Task :DTO:extractDebugAnnotations
> Task :DTO:compileDebugJavaWithJavac
> Task :DTO:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :DTO:mergeDebugConsumerProguardFiles
> Task :DTO:mergeDebugJavaResource
> Task :DTO:syncDebugLibJars
> Task :Global:generateDebugRFile
> Task :DTO:bundleDebugAar
> Task :DTO:assembleDebug
> Task :DTO:bundleLibCompileToJarDebug
> Task :app:dataBindingTriggerDebug
> Task :app:generateDebugBuildConfig
> Task :Background:writeDebugAarMetadata
> Task :Common:writeDebugAarMetadata
> Task :Services:writeDebugAarMetadata
> Task :app:createDebugCompatibleScreenManifests
> Task :app:extractDeepLinksDebug
> Task :Background:extractDeepLinksDebug
> Task :Common:extractDeepLinksDebug
> Task :Core:extractDeepLinksDebug
> Task :DTO:extractDeepLinksDebug
> Task :Global:extractDeepLinksDebug
> Task :Background:processDebugManifest
> Task :Repository:extractDeepLinksDebug
> Task :Services:extractDeepLinksDebug
> Task :Services:processDebugManifest
> Task :Background:compileDebugLibraryResources
> Task :Background:parseDebugLocalResources
> Task :Services:parseDebugLocalResources
> Task :Common:compileDebugLibraryResources
> Task :Core:compileDebugLibraryResources
> Task :DTO:compileDebugLibraryResources
> Task :Global:compileDebugLibraryResources
> Task :app:processDebugMainManifest
> Task :app:processDebugManifest
> Task :Repository:compileDebugLibraryResources
> Task :Services:compileDebugLibraryResources

> Task :app:mergeDebugResources
/Users/JohnDoe/StudioProjects/android_myapp/app/src/main/res/values-zh/attrs.xml:6:4: Ignoring configuration 'zh' for <declare-styleable> tag.
/Users/JohnDoe/StudioProjects/android_myapp/app/src/main/res/values-zh/attrs.xml:2:4: Ignoring configuration 'zh' for <declare-styleable> tag.
/Users/JohnDoe/StudioProjects/android_myapp/app/src/main/res/values-zh/attrs.xml:10:4: Ignoring configuration 'zh' for <declare-styleable> tag.
/Users/JohnDoe/StudioProjects/android_myapp/app/src/main/res/values-zh/styles.xml:76:5: Ignoring configuration 'zh' for <declare-styleable> tag.

> Task :app:checkDebugAarMetadata
> Task :app:dataBindingGenBaseClassesDebug
> Task :app:mapDebugSourceSetPaths
> Task :Background:generateDebugBuildConfig
> Task :Services:generateDebugBuildConfig
> Task :Services:javaPreCompileDebug
> Task :Background:javaPreCompileDebug
> Task :app:mergeDebugShaders
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:javaPreCompileDebug
> Task :Background:mergeDebugShaders
> Task :Background:compileDebugShaders NO-SOURCE
> Task :Background:generateDebugAssets UP-TO-DATE
> Task :Background:packageDebugAssets
> Task :Common:mergeDebugShaders
> Task :Common:compileDebugShaders NO-SOURCE
> Task :Common:generateDebugAssets UP-TO-DATE
> Task :Common:packageDebugAssets
> Task :Services:mergeDebugShaders
> Task :Services:compileDebugShaders NO-SOURCE
> Task :Services:generateDebugAssets UP-TO-DATE
> Task :Services:packageDebugAssets
> Task :app:mergeDebugAssets
> Task :app:processDebugJavaRes NO-SOURCE
> Task :Background:processDebugJavaRes NO-SOURCE
> Task :Common:processDebugJavaRes NO-SOURCE
> Task :Core:bundleLibResDebug NO-SOURCE
> Task :DTO:bundleLibResDebug NO-SOURCE
> Task :Services:processDebugJavaRes NO-SOURCE
> Task :app:compressDebugAssets
> Task :app:checkDebugDuplicateClasses
> Task :Global:compileDebugKotlin NO-SOURCE
> Task :Common:generateDebugRFile
> Task :Global:compileDebugJavaWithJavac
> Task :Global:bundleLibCompileToJarDebug

> Task :Global:extractDebugAnnotations FAILED
/Users/JohnDoe/StudioProjects/android_myapp/Global/build/tmp/kotlin-classes/debug does not exist

> Task :Global:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :Global:mergeDebugConsumerProguardFiles
> Task :Global:bundleLibResDebug NO-SOURCE
> Task :Global:mergeDebugJavaResource
> Task :app:processDebugManifestForPackage
> Task :app:mergeDebugJniLibFolders
> Task :DTO:bundleLibRuntimeToDirDebug
> Task :Background:mergeDebugJniLibFolders
> Task :Core:bundleLibRuntimeToDirDebug
> Task :Background:mergeDebugNativeLibs NO-SOURCE
> Task :Background:copyDebugJniLibsProjectOnly
> Task :Common:mergeDebugJniLibFolders
> Task :Common:mergeDebugNativeLibs NO-SOURCE
> Task :Common:copyDebugJniLibsProjectOnly
> Task :Core:copyDebugJniLibsProjectOnly
> Task :DTO:copyDebugJniLibsProjectOnly
> Task :Global:bundleLibRuntimeToDirDebug
> Task :Global:copyDebugJniLibsProjectOnly
> Task :Repository:copyDebugJniLibsProjectOnly
> Task :Services:mergeDebugJniLibFolders
> Task :Services:mergeDebugNativeLibs NO-SOURCE
> Task :Services:copyDebugJniLibsProjectOnly
> Task :app:validateSigningDebug
> Task :app:writeDebugAppMetadata
> Task :app:writeDebugSigningConfigVersions
> Task :Security:preBuild UP-TO-DATE
> Task :Security:preDebugBuild UP-TO-DATE
> Task :Security:compileDebugAidl NO-SOURCE
> Task :Security:mergeDebugJniLibFolders
> Task :Security:mergeDebugNativeLibs NO-SOURCE
> Task :Security:stripDebugDebugSymbols NO-SOURCE
> Task :Security:copyDebugJniLibsProjectAndLocalJars
> Task :Security:compileDebugRenderscript NO-SOURCE
> Task :Security:generateDebugBuildConfig
> Task :Security:generateDebugResValues
> Task :Security:generateDebugResources
> Task :Security:packageDebugResources
> Task :Security:parseDebugLocalResources
> Task :Common:compileDebugKotlin NO-SOURCE

> Task :Common:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :Common:bundleLibCompileToJarDebug
> Task :Common:bundleLibResDebug NO-SOURCE
> Task :Common:bundleLibRuntimeToDirDebug
> Task :Repository:generateDebugRFile
> Task :app:mergeDebugNativeLibs NO-SOURCE
> Task :app:stripDebugDebugSymbols NO-SOURCE
> Task :Security:javaPreCompileDebug
> Task :Security:mergeDebugShaders
> Task :Security:compileDebugShaders NO-SOURCE
> Task :Security:generateDebugAssets UP-TO-DATE
> Task :Security:processDebugManifest
> Task :Security:packageDebugAssets
> Task :Security:packageDebugRenderscript NO-SOURCE
> Task :Security:prepareDebugArtProfile UP-TO-DATE
> Task :Security:prepareLintJarForPublish UP-TO-DATE
> Task :Security:processDebugJavaRes NO-SOURCE
> Task :Security:generateDebugRFile
> Task :Services:stripDebugDebugSymbols NO-SOURCE
> Task :Security:writeDebugAarMetadata
> Task :Security:compileDebugKotlin NO-SOURCE
> Task :Security:extractDebugAnnotations
> Task :Security:compileDebugJavaWithJavac
> Task :Security:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :Security:mergeDebugConsumerProguardFiles
> Task :Security:mergeDebugJavaResource
> Task :Security:syncDebugLibJars
> Task :Security:bundleDebugAar
> Task :Security:assembleDebug
> Task :Services:copyDebugJniLibsProjectAndLocalJars
> Task :Repository:compileDebugKotlin NO-SOURCE
> Task :Services:generateDebugRFile
> Task :Repository:extractDebugAnnotations
> Task :Repository:compileDebugJavaWithJavac
> Task :Repository:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :Repository:mergeDebugConsumerProguardFiles
> Task :Repository:mergeDebugJavaResource
> Task :Repository:bundleLibCompileToJarDebug
> Task :Repository:syncDebugLibJars
> Task :Repository:bundleDebugAar
> Task :Repository:assembleDebug
> Task :Repository:bundleLibResDebug NO-SOURCE
> Task :Services:prepareDebugArtProfile UP-TO-DATE
> Task :Services:prepareLintJarForPublish UP-TO-DATE
> Task :Exception:preBuild UP-TO-DATE
> Task :Exception:preDebugBuild UP-TO-DATE
> Task :Exception:compileDebugAidl NO-SOURCE
> Task :Exception:mergeDebugJniLibFolders
> Task :Exception:mergeDebugNativeLibs NO-SOURCE
> Task :Exception:stripDebugDebugSymbols NO-SOURCE
> Task :Repository:bundleLibRuntimeToDirDebug
> Task :Exception:copyDebugJniLibsProjectAndLocalJars
> Task :app:desugarDebugFileDependencies
> Task :Background:generateDebugRFile
> Task :Services:compileDebugKotlin NO-SOURCE
> Task :Services:compileDebugJavaWithJavac
> Task :Services:bundleLibResDebug NO-SOURCE
> Task :Services:bundleLibCompileToJarDebug
> Task :Services:bundleLibRuntimeToDirDebug
> Task :Services:extractDebugAnnotations
> Task :Services:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :Services:mergeDebugConsumerProguardFiles
> Task :Exception:compileDebugRenderscript NO-SOURCE
> Task :Services:mergeDebugJavaResource
> Task :Exception:generateDebugBuildConfig
> Task :Services:syncDebugLibJars
> Task :Services:bundleDebugAar
> Task :Services:assembleDebug
> Task :Exception:generateDebugResValues
> Task :Exception:generateDebugResources
> Task :Exception:packageDebugResources
> Task :Exception:parseDebugLocalResources
> Task :Exception:javaPreCompileDebug
> Task :Exception:mergeDebugShaders
> Task :Exception:compileDebugShaders NO-SOURCE
> Task :Exception:generateDebugAssets UP-TO-DATE
> Task :Exception:processDebugManifest
> Task :Background:compileDebugKotlin NO-SOURCE
> Task :Background:compileDebugJavaWithJavac
> Task :Background:bundleLibResDebug NO-SOURCE
> Task :Background:bundleLibCompileToJarDebug
> Task :Background:bundleLibRuntimeToDirDebug
> Task :Exception:packageDebugAssets
> Task :Exception:generateDebugRFile
> Task :Exception:packageDebugRenderscript NO-SOURCE
> Task :Exception:compileDebugKotlin NO-SOURCE
> Task :Exception:extractDebugAnnotations
> Task :Exception:compileDebugJavaWithJavac
> Task :Exception:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :Exception:mergeDebugConsumerProguardFiles
> Task :Exception:prepareDebugArtProfile UP-TO-DATE
> Task :Exception:prepareLintJarForPublish UP-TO-DATE
> Task :Exception:processDebugJavaRes NO-SOURCE
> Task :Exception:mergeDebugJavaResource
> Task :Exception:writeDebugAarMetadata
> Task :Exception:syncDebugLibJars
> Task :Exception:bundleDebugAar
> Task :Exception:assembleDebug
> Task :Background:stripDebugDebugSymbols NO-SOURCE
> Task :Background:copyDebugJniLibsProjectAndLocalJars
> Task :Background:extractDebugAnnotations
> Task :Background:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :Background:mergeDebugConsumerProguardFiles
> Task :Background:prepareDebugArtProfile UP-TO-DATE
> Task :Background:prepareLintJarForPublish UP-TO-DATE
> Task :app:mergeLibDexDebug
> Task :Background:mergeDebugJavaResource
> Task :Common:stripDebugDebugSymbols NO-SOURCE
> Task :Background:syncDebugLibJars
> Task :Background:bundleDebugAar
> Task :Background:assembleDebug
> Task :Common:copyDebugJniLibsProjectAndLocalJars
> Task :Common:extractDebugAnnotations
> Task :Common:mergeDebugGeneratedProguardFiles UP-TO-DATE
> Task :Common:mergeDebugConsumerProguardFiles
> Task :Common:prepareDebugArtProfile UP-TO-DATE
> Task :Common:prepareLintJarForPublish UP-TO-DATE
> Task :Common:mergeDebugJavaResource
> Task :Common:syncDebugLibJars
> Task :Common:bundleDebugAar
> Task :Common:assembleDebug
> Task :app:processDebugResources
> Task :app:compileDebugKotlin

> Task :app:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :app:dexBuilderDebug
> Task :app:mergeProjectDexDebug
> Task :app:mergeDebugJavaResource
> Task :app:mergeExtDexDebug
> Task :app:packageDebug
> Task :app:createDebugApkListingFileRedirect
> Task :app:assembleDebug

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':Core:extractDebugAnnotations'.
> A failure occurred while executing com.android.build.gradle.internal.lint.AndroidLintWorkAction
   > Internal error: unexpected lint return value -1

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':Global:extractDebugAnnotations'.
> A failure occurred while executing com.android.build.gradle.internal.lint.AndroidLintWorkAction
   > Internal error: unexpected lint return value -1

* 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 25s
264 actionable tasks: 237 executed, 27 up-to-date

但仍然无法找到有关“Task :extractDebugAnnotations FAILED”错误的更多信息。

android android-studio kotlin gradle build
3个回答
2
投票

好吧,不知道为什么,但是删除后

apply plugin: 'kotlin-android'

从我的“核心”和“全局”模块 build.gradle 现在应用程序已成功构建。

我不知道为什么其他模块接受 apply 插件:build.gradle 中的“kotlin-android”而不是“Core”和“Global”,我什至不知道我是否能够在然后这两个模块,但目前应用程序构建得很好。


0
投票

我有完全相同的问题。我的项目中的 5 个模块中有 3 个生成了错误,但其中 2 个运行得很好。解决方案非常不寻常,因为它只需要在每个模块中创建空的 Kotlin 文件。看起来在模块中添加 Kotlin 插件后,它必须至少有一个 Kotlin 文件,否则会生成错误。


0
投票

kapt.include.compile.classpath=true 或删除 kapt.include.compile.classpath

© www.soinside.com 2019 - 2024. All rights reserved.