android - 无法解析符号 MyObjectBox

标签 android database greendao objectbox

我使用的是对象框版本 1.1.0。按照 ObjectBox 文档中给出的说明进行安装,但出现此错误。即使我在 Objectbox 的常见问题解答部分搜索了这个问题,他们提供的解决方案是删除 android-apt。但是在 gradle 文件中没有使用 android-apt。那么,如何克服这个问题请帮助我。波纹管是我的根级 gradle 文件

buildscript {
ext {
    _buildToolsVersion = '26.0.1'
    _compileSdkVersion = 26
    objectboxVersion = '1.1.0'
}
repositories {
    jcenter()
    mavenCentral()
    maven { url "http://objectbox.net/beta-repo/" }
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath 'com.google.gms:google-services:3.1.0'
    classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"
}
 }allprojects {
repositories {
    jcenter()
    mavenCentral()
    maven {
        url 'https://maven.fabric.io/public'
    }
    maven { url "http://objectbox.net/beta-repo/"
}
}
 task clean(type: Delete) {
 delete rootProject.buildDir
}

应用程序gradle文件如下

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
    applicationId "com.kingof.android"
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 3
    versionName "1.001"
    multiDexEnabled = true
    testInstrumentationRunner 
    "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
     'proguard-rules.pro'
    }
   }
   lintOptions {
      disable 'ValidFragment'
    }
    }
     repositories{
        mavenCentral()
      }
    dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
     androidTestCompile('com.android.support.test.espresso:espresso-
     core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
       })
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.firebaseui:firebase-ui:1.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-ads:10.0.1'


compile 'com.patrickpissurno:ripple-effect:1.3.1'
compile 'com.google.code.gson:gson:2.7'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.snatik:storage:2.1.0'
compile 'jp.wasabeef:glide-transformations:2.0.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile "io.objectbox:objectbox-android:$objectboxVersion"


 }apply plugin: 'com.google.gms.google-services'
   apply plugin: 'io.objectbox'

最佳答案

MyObjectBox 类是在构建过程中生成的,我认为您至少需要一个带有 @Entity 注释的模型文件才能生成它。

关于android - 无法解析符号 MyObjectBox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46572749/

相关文章:

c - 在哪里可以找到使用 struct 在 C 中创建的数据库的一些示例?

android - ObjectBox 惰性列表行为

android - 在安卓 : How to define proper Animation to maximize one View while minimizing 2 others at the same time?

mysql - 使用 SQL 对位置进行排名

php - 将 MySQL 链接传递给类方法

android - greenDao @ToMany 关系不起作用,返回 0

android - 如何在没有 ID 的情况下创建新对象并将其插入到我的数据库中?

java - 验证来自 Android 应用程序的后端调用

java - 根据屏幕尺寸显示图像

android - 我可以解析 Soap 解析这种类型吗?