gpt4 book ai didi

java - Android 由 : java. lang.RuntimeException 引起

转载 作者:行者123 更新时间:2023-12-01 07:45:30 25 4
gpt4 key购买 nike

我收到一条错误消息,就像标题中一样,但没有上下文,它的原因是:java.lang.RuntimeException 如果我不知道导致它的原因,我该如何知道要修复什么。代码在这里:https://bitbucket.org/Hellscythe94/meet-up/src/master/

当我将此行添加到登录 fragment 时显示错误:警报对话框.show();

但是即使我评论了它也不起作用......

请帮助我,我刚刚开始使用 android。

好的,我创建了一个新的空白项目,只是添加了依赖项并尝试构建它,但遇到了同样的问题。

This is my project/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
}
}

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

这是我的项目/app/build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
multiDexEnabled true
applicationId "com.example.michalwolowiec.meetup"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
def lifecycle_version = "1.1.1"
implementation fileTree(include: ['*.jar'], dir: 'libs')
//MultiDex
implementation 'com.android.support:multidex:1.0.3'
//App compat
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:$lifecycle_version"
//Lifecycles only (no ViewModel or LiveData).
//Support library depends on this lightweight import
implementation "android.arch.lifecycle:runtime:$lifecycle_version"
//firebase Authentication
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-auth:16.1.0'
//firebase cloud Firebase
implementation 'com.google.firebase:firebase-firestore:17.1.4'
//butterknife and lombok
implementation 'com.jakewharton:butterknife:9.0.0-rc1'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
compileOnly 'org.projectlombok:lombok:1.18.4'
annotationProcessor 'org.projectlombok:lombok:1.18.4'
//google shit
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
//RX
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
//libraries
implementation 'io.nlopez.smartlocation:library:3.3.3'
implementation 'io.nlopez.smartlocation:rx:3.3.1'
implementation 'com.google.code.gson:gson:2.8.5'
//tests
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply
plugin: 'com.google.gms.google-services'

现在有人可以告诉我我做错了什么吗?

The problem

最佳答案

好的,我解决了。

事实证明,因为我得到了这是我的project/app/build.gradle

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

但是删除后它可以正常工作。所以问题可能是我正在做一些在 JAVA 1.7 中可以接受但在 JAVA 1.8 中 Not Acceptable 事情。

关于java - Android 由 : java. lang.RuntimeException 引起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53802932/

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