80,337
社区成员
发帖
与我相关
我的任务
分享
classpath "io.realm:realm-gradle-plugin:4.3.1"
写错了,没有4.0.2classpath "io.realm:realm-gradle-plugin:2.0.2"
改成
classpath "io.realm:realm-gradle-plugin:4.0.2"
2.0.2都是两年前的版本了
另外,你的butterknife版本要保持一致,不然可能出现问题
implementation 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
allprojects {
repositories {
jcenter()
google()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
}
}
另外,你的support库最好保持版本一致
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:cardview-v7:25.4.0'
implementation 'com.android.support:recyclerview-v7:25.4.0'
classpath "io.realm:realm-gradle-plugin:4.3.1"
写错了,没有4.0.2[/quote]
我按照您的改了后,之前的那个错误没有了 但是又出现了新的错误,而且 我还看不懂,麻烦您再看看?
这是错误原因:
Error:Could not resolve all files for configuration ':app:debugAnnotationProcessorClasspath'.
> Could not download javawriter.jar (com.squareup:javawriter:2.5.1)
> Could not get resource 'https://jcenter.bintray.com/com/squareup/javawriter/2.5.1/javawriter-2.5.1.jar'.
> Could not GET 'https://jcenter.bintray.com/com/squareup/javawriter/2.5.1/javawriter-2.5.1.jar'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/108.168.243.150] failed: Connection timed out: connectapply plugin: 'realm-android'
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "f3.nsu.com.habit"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'realm-android'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'com.jakewharton:butterknife:8.5.1'
implementation 'com.wx.wheelview:wheelview:1.3.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
implementation 'com.android.support:cardview-v7:25.3.1'
implementation 'com.android.support:recyclerview-v7:25.1.1'
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "io.realm:realm-gradle-plugin:2.0.2"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}