我正在尝试使用两个模块构建一个Android应用程序项目,其中一个模块包含Kotlin代码。我在构建时遇到以下错误,我不知道如何修复它。
警告和错误(粗体):
w: warning: Supported source version 'RELEASE_7' from annotation processor 'org.jetbrains.kotlin.kapt3.ProcessorWrapper' less than -source '1.8'
**e: C:\android_workspace\anapp_android\VideoApp\core\build\tmp\kapt3\stubs\debug\co\acompany\videoapp\db\model\DbChannelDetails.java:12: error: Cannot find getter for field.
private java.lang.String id;
^**
w: C:\android_workspace\anapp_android\VideoApp\core\build\tmp\kapt3\stubs\debug\co\acompany\anapp\db\CompanyDatabase.java:7: warning: Schema export directory is not provided to the annotation processor so we cannot export the schema. You can either provide `room.schemaLocation` annotation processor argument OR set exportSchema to false.
public abstract class CompanyDatabase extends android.arch.persistence.room.RoomDatabase {
^
:core:kaptDebugKotlin FAILED
:app:buildInfoGeneratorAllguitarnetworkProDebug
这是相关的类文件:
C:\ android_workspace \ anapp_android \ VideoApp \芯\构建\ TMP \ kapt3 \存根\调试\共\ acompany \ videoapp \分贝\模型\ DbChannelDetails.java:
package co.acompany.videoapp.db.model;
import java.lang.System;
@android.arch.persistence.room.Entity(tableName = "channel_details")
@kotlin.Metadata(mv = {1, 1, 9}, bv = {1, 0, 2}, k = 1, d1 =
{"\u0000$\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0010\t\n\u0002\b\b\b\u0007\u0018\u00002\u00020\u0001B\u0007\b\u0016\u00a2\u0006\u0002\u0010\u0002B\u000f\b\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u00a2\u0006\u0002\u0010\u0005R\u001e\u0010\u0006\u001a\u00020\u00078\u0006@\u0006X\u0087\u000e\u00a2\u0006\u000e\n\u0000\u001a\u0004\b\b\u0010\t\"\u0004\b\n\u0010\u000bR\u001e\u0010\f\u001a\u00020\r8\u0006@\u0006X\u0087\u000e\u00a2\u0006\u000e\n\u0000\u001a\u0004\b\u000e\u0010\u000f\"\u0004\b\u0010\u0010\u0011R\u001e\u0010\u0012\u001a\u00020\u00078\u0006@\u0006X\u0087\u000e\u00a2\u0006\u000e\n\u0000\u001a\u0004\b\u0013\u0010\t\"\u0004\b\u0014\u0010\u000b\u00a8\u0006\u0015"}, d2 = {"Lco/acompany/videoapp/db/model/DbChannelDetails;", "", "()V", "details", "Lco/acompany/videoapp/api/model/ChannelDetails;", "(Lco/acompany/videoapp/api/model/ChannelDetails;)V", "id", "", "getId", "()Ljava/lang/String;", "setId", "(Ljava/lang/String;)V", "rowId", "", "getRowId", "()J", "setRowId", "(J)V", "title", "getTitle", "setTitle", "core_debug"})
public final class DbChannelDetails {
@android.arch.persistence.room.PrimaryKey(autoGenerate = true)
private long rowId;
@org.jetbrains.annotations.NotNull()
@android.arch.persistence.room.ColumnInfo()
private java.lang.String id;
@org.jetbrains.annotations.NotNull()
@android.arch.persistence.room.ColumnInfo()
private java.lang.String title;
public final long getRowId() {
return 0L;
}
public final void setRowId(long p0) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getId() {
return null;
}
public final void setId(@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getTitle() {
return null;
}
public final void setTitle(@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
public DbChannelDetails() {
super();
}
public DbChannelDetails(@org.jetbrains.annotations.NotNull()
co.acompany.videoapp.api.model.ChannelDetails details) {
super();
}
答案 0 :(得分:-1)
尝试将future.recover {
case f: Exception => 0
}
字段的可见性更改为@PrimaryKey
。
protected