gpt4 book ai didi

java.lang.NullPointerException(无错误信息)APK构建

转载 作者:搜寻专家 更新时间:2023-10-30 19:57:41 25 4
gpt4 key购买 nike

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
jcenter()
}
dependencies {
classpath "gradle.plugin.me.tatarka:gradle-retrolambda:3.3.0"
classpath 'com.android.tools.build:gradle:2.2.1'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

:app 文件

apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "24.0.3"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "it.univpm.gruppoids.iotforemergencyandnavigation"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"

jackOptions {
enabled true
}
}



buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
compile 'com.google.zxing:core:3.2.1'
compile 'org.jgrapht:jgrapht-core:1.0.0'
}

当我尝试构建 APK 时,它显示:错误:配置项目“:app”时出现问题。

java.lang.NullPointerException (no error message)

是不是版本问题?还是与 lamdas?有人可以帮助我吗?

最佳答案

添加后我遇到了同样的问题:

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

因为我默认的java版本是10:

$ java -version
java version "10.0.1" 2018-04-17

更改为 1.8 后(使用 sudo update-alternatives --config java)问题已修复。

关于java.lang.NullPointerException(无错误信息)APK构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40108471/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com