今天修改build.gradle中的依赖,并修改了代码,突然不能运行。
报错:
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
找来找去,说什么的都有。最后还是要结合自己代码情况,查找问题。这里记录一下查找问题的方式:
解决方式:
Run your application with ./gradlew clean build command to see what’s exactly wrong with your code. Just paste it into the Terminal in Android Studio.
在Terminal 中运行gradlew clean build,来校验编译。如果出错,这里会列出详细的代码信息,然后一一解决。
这里记录一下,学无止境!!!