2017-10-04 144 views
2

我正在使用对象盒版本1.1.0。按照ObjectBox文档中给出的说明进行安装,但出现此错误。即使我在Objectbox的FAQ部分搜索了这个问题,他们提供的解决方案是删除android-apt。但在gradle文件中没有使用android-apt。那么,如何克服这个问题请帮助我。贝娄是我的根级别gradle这个文件无法解析符号MyObjectBox

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' 
+0

你也可以分享你的应用的Gradle文件吗? –

+0

@MarkusJunginger应用程序的Gradle文件增加了 –

回答

2

MyObjectBox构建过程中产生类,我认为你需要有至少一个模型文件,@要为其生成实体注释。

+0

有趣......这是我在修复所有标有错误的行之前第一次尝试构建,但错误*会在构建之后消失。 – Michael