我正在尝试将对象框集成到我现有的 android 项目中,但出现错误。是否有任何 JAVA 8 版本问题或对象框兼容性问题。是否有任何 gradle 版本和对象框兼容性问题。我被困在这一点上。
Error:Could not find io.objectbox:objectbox-gradle-plugin:1.3.3.
Searched in the following locations:
file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/objectbox/objectbox-gradle-plugin/1.3.3/objectbox-gradle-plugin-1.3.3.pom
file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/objectbox/objectbox-gradle-plugin/1.3.3/objectbox-gradle-plugin-1.3.3.jar
https://maven.fabric.io/public/io/objectbox/objectbox-gradle-plugin/1.3.3/objectbox-gradle-plugin-1.3.3.pom
https://maven.fabric.io/public/io/objectbox/objectbox-gradle-plugin/1.3.3/objectbox-gradle-plugin-1.3.3.jar
以下是我的 gradle 文件 Build.gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
compileSdkVersion = 25
minSDKVersion = 18
targetSDKVersion = 25
buildToolsVersion = "26.0.2"
supportLibVersion = "25.3.1"
playServicesVersion = "11.0.2"
digitsVersion = "1.10.3"
crashlyticsVersion = "2.8.0"
facebookStethoVersion = "1.5.0"
facebookSDKVersion = "4.7.0"
jUnitVersion = "4.12"
squareUpOkHttpVersion = "3.9.1"
squareUpRetrofitVersion = "2.3.0"
squareUpPicassoVersion = "2.5.2"
eventBusVersion = "3.1.1"
commonsIOVersion = "2.5"
commonsLangVersion = "3.7"
ThinDownloadManagerVersion = "1.3.0"
exoplayerVersion = "r1.5.8"
constraintLayoutVersion = "1.0.2"
leakCanaryVersion = "1.5.1"
textDrawableVersion = '1.0.1'
badgeViewVersion = '1.1.0'
zxingVersion = '3.5.0'
multidexVersion = '1.0.2'
androidTagViewVersion = '1.1.4'
ical4jVersion = '2.0.5'
calendarViewVersion = '1.0.4'
commonsCodecVersion = '1.10'
concurrentUtilVersion = '3.1'
AndroidAudioRecorderVersion = '0.3.0'
objectboxVersion = '1.3.3'
}
buildscript {
repositories {
maven { url "http://objectbox.net/beta-repo/" }
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// classpath 'com.google.gms:google-services:1.5.0'
classpath 'com.google.gms:google-services:3.1.0'
// classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.3"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
maven { url "http://objectbox.net/beta-repo/" }
}
}
dependencies {
}
和模块级 gradle :
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"
}
}
configurations {
// referenced in some portable lib. use android internal instead
compile.exclude group: 'commons-logging'
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'io.objectbox'
//apply plugin: 'sonar'
//apply plugin: "org.sonarqube"
repositories {
maven { url 'https://maven.fabric.io/public' }
maven {
url "https://jitpack.io"
}
google()
}
android {
dexOptions {
jumboMode true
}
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
// jackOptions {
// enabled true
// }
android.defaultConfig.vectorDrawables.useSupportLibrary = true
applicationId "com.example.example2"
minSdkVersion rootProject.ext.minSDKVersion
targetSdkVersion rootProject.ext.targetSDKVersion
multiDexEnabled true
}
// compileOptions {
// sourceCompatibility JavaVersion.VERSION_1_8
// targetCompatibility JavaVersion.VERSION_1_8
// }
}
sourceSets {
main {
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile("com.crashlytics.sdk.android:crashlytics:${rootProject.ext.crashlyticsVersion}@aar") {
transitive = true
}
compile("com.digits.sdk.android:digits:${rootProject.ext.digitsVersion}@aar") {
transitive = true
}
compile "com.google.android.gms:play-services-location:${rootProject.ext.playServicesVersion}"
compile "com.google.firebase:firebase-messaging:${rootProject.ext.playServicesVersion}"
compile "com.google.firebase:firebase-auth:${rootProject.ext.playServicesVersion}"
compile "com.google.firebase:firebase-core:${rootProject.ext.playServicesVersion}"
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
compile "com.android.support:design:${rootProject.ext.supportLibVersion}"
compile "com.android.support:cardview-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:support-v13:${rootProject.ext.supportLibVersion}"
androidTestCompile "com.android.support:support-annotations:${rootProject.ext.supportLibVersion}"
compile "com.facebook.stetho:stetho:${rootProject.ext.facebookStethoVersion}"
compile "com.facebook.stetho:stetho-okhttp3:${rootProject.ext.facebookStethoVersion}"
compile "com.facebook.android:facebook-android-sdk:${rootProject.ext.facebookSDKVersion}"
compile "com.squareup.okhttp3:okhttp:${rootProject.ext.squareUpOkHttpVersion}"
compile "com.squareup.okhttp3:logging-interceptor:${rootProject.ext.squareUpOkHttpVersion}"
compile "com.squareup.picasso:picasso:${rootProject.ext.squareUpPicassoVersion}"
compile "com.squareup.retrofit2:retrofit:${rootProject.ext.squareUpRetrofitVersion}"
compile "com.squareup.retrofit2:converter-gson:${rootProject.ext.squareUpRetrofitVersion}"
testCompile "junit:junit:${rootProject.ext.jUnitVersion}"
compile "commons-io:commons-io:${rootProject.ext.commonsIOVersion}"
compile "org.apache.commons:commons-lang3:${rootProject.ext.commonsLangVersion}"
compile "com.mani:ThinDownloadManager:${rootProject.ext.ThinDownloadManagerVersion}"
compile "com.google.android.exoplayer:exoplayer:${rootProject.ext.exoplayerVersion}"
compile "com.android.support.constraint:constraint-layout:${rootProject.ext.constraintLayoutVersion}"
debugCompile "com.squareup.leakcanary:leakcanary-android:${rootProject.ext.leakCanaryVersion}"
releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:${rootProject.ext.leakCanaryVersion}"
testCompile "com.squareup.leakcanary:leakcanary-android-no-op:${rootProject.ext.leakCanaryVersion}"
compile "org.greenrobot:eventbus:${rootProject.ext.eventBusVersion}"
compile "com.amulyakhare:com.amulyakhare.textdrawable:${rootProject.ext.textDrawableVersion}"
compile "q.rorbin:badgeview:${rootProject.ext.badgeViewVersion}"
compile "com.journeyapps:zxing-android-embedded:${rootProject.ext.zxingVersion}"
compile "co.lujun:androidtagview:${rootProject.ext.androidTagViewVersion}"
compile "org.mnode.ical4j:ical4j:${rootProject.ext.ical4jVersion}"
compile "com.android.support:multidex:${rootProject.ext.multidexVersion}"
compile "backport-util-concurrent:backport-util-concurrent:${rootProject.ext.concurrentUtilVersion}"
compile "commons-codec:commons-codec:${rootProject.ext.commonsCodecVersion}"
compile "com.github.tibolte:agendacalendarview:${rootProject.ext.calendarViewVersion}"
compile "com.github.adrielcafe:AndroidAudioRecorder:${rootProject.ext.AndroidAudioRecorderVersion}"
debugCompile "io.objectbox:objectbox-android-objectbrowser:$objectboxVersion"
releaseCompile "io.objectbox:objectbox-android:$objectboxVersion"
}
apply plugin: 'com.google.gms.google-services'