0

请帮忙。我正在尽一切可能将objectbox集成到一个android项目中,每次尝试都会出错。我不确定 objectbox 版本和 android studio gradle 版本之间是否存在兼容性问题。我目前正在运行 gradle 4.3.1 并集成对象 1.3.4。

project.build gradle 文件

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




 buildscript {
        //ext.objectboxVersion = '1.3.4'
        repositories {
            google()
            jcenter()
            maven {
                url "http://objectbox.net/beta-repo/"
            }

            dependencies {
                // need to include in top build file
                // https://developer.android.com/studio/build/gradle-plugin-3-0-0.html#known_issues
                classpath 'com.android.tools.build:gradle:3.0.1'
                classpath "io.objectbox:objectbox-gradle-plugin:1.4.0"
            }
        }

        allprojects {
            repositories {
                maven { url "http://objectbox.net/beta-repo/" }
                google()
                jcenter()
                mavenCentral()
            }
        }

        repositories {
            //maven { url "http://objectbox.net/beta-repo/" }
            jcenter()
            mavenCentral()
            google()
        }
    }

app.build gradle 文件

apply plugin: 'com.android.application'


dependencies {
    debugCompile "io.objectbox:objectbox-android-objectbrowser:1.4.0"
    releaseCompile "io.objectbox:objectbox-android:1.4.0"
    compile 'io.objectbox:objectbox-java:1.4.0'
    annotationProcessor "io.objectbox:objectbox-processor:1.4.0"
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'io.objectbox'

android {
    compileSdkVersion 26
    buildToolsVersion "27.0.1"

    defaultConfig {
        applicationId "com.example.novo0007.objectbox"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

错误: 点击此处查看错误图片

错误:找不到 io.objectbox:objectbox-gradle-plugin:1.3.4。要求:project :app 在 build.gradle 文件中搜索

4

0 回答 0