android项目构建

143 阅读1分钟

新开发了一个项目,报如下错误

java.lang.RuntimeException: Unable to instantiate application **.**.**.App: 
java.lang.ClassNotFoundException: Didn't find class "**.**.**.App" on path: DexPathList

解决方案

在build.gradle(app)-android-添加如下代码
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}