本文介绍了原因:buildOutput.apkData 不能为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试在手机的模拟器 o 中运行应用程序"时,我使用 Kotlin 的 android 应用程序抛出此异常.当我构建我的项目时,它运行良好,没有错误.
My android application using Kotlin is throwing this exception when I try to Run 'app' in the emulator o in my cellphone. When I build my project it runs well, with no errors.
我正在使用:
- SDK 28(Android 9.0(派))
- Gradle 5.1.1
- Gradle 插件 3.5.0-alpha03
- 科特林 1.3.10
- Java 1.8.0_151
- OSX 10.13.2
org.gradle.internal.exceptions.LocationAwareException: buildOutput.apkData must not be null
at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:99)
at org.gradle.initialization.exception.DefaultExceptionAnalyser.collectFailures(DefaultExceptionAnalyser.java:65)
at org.gradle.initialization.exception.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:39)
at org.gradle.initialization.exception.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:29)
at org.gradle.initialization.DefaultGradleLauncher.finishBuild(DefaultGradleLauncher.java:194)
at org.gradle.initialization.DefaultGradleLauncher.finishBuild(DefaultGradleLauncher.java:141)
...
Caused by: java.lang.IllegalStateException: buildOutput.apkData must not be null
at com.android.build.gradle.internal.ide.EarlySyncBuildOutput$Companion$load$2.invoke(EarlySyncBuildOutput.kt:103)
at com.android.build.gradle.internal.ide.EarlySyncBuildOutput$Companion$load$2.invoke(EarlySyncBuildOutput.kt:67)
at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:174)
at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:691)
at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:721)
at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:712)
...
推荐答案
点击Build
-> Clean Project
然后Build
-> Make Project
在 gradle 3.5.0-alpha3、-alpha5 和 3.4.0(项目 gradle)上测试
Tested on gradle 3.5.0-alpha3, -alpha5 and 3.4.0 (project gradle)
classpath 'com.android.tools.build:gradle:3.5.0-alpha03'
这篇关于原因:buildOutput.apkData 不能为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!