Buttknife不能与RXJava一起使用 [英] Buttknife not working with RXJava
本文介绍了Buttknife不能与RXJava一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Gradle文件
$ b
apply plugin:'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion25.0.3
defaultConfig {
applicationId pe.com.gmd.innova.adexus.adexusday
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName1.0
multiDexEnabled true
testInstrumentationRunner android.support.test.runner.AndroidJUnitRunner
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaV ersion.VERSION_1_8
greendao {
schemaVersion 7
} * /
依赖项{
编译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(name:'androidgmd2',ext:'aar')
compile'com.android。支持:appcompat-v7:25.3.1'
compile'com.jakewharton:butterknife:7.0.1'
compile'com.android.support:design:25.3.1'
compile' com.android.support:cardview-v7:25.3.1'
compile'com.android.support:recyclerview-v7:25.3.1'
compile'com.android.support:multidex:1.0。 1'
compile'org.greenrobot:greendao:3.2.2'
compile'com.nineoldandroids:library:2.4.0'
compile'com.daimajia.androidanimations:library:1.1。 3 @ aar'
compile'com .github.bumptech.glide:glide:3.7.0'
compile'com.squareup.retrofit2:retrofit:2.0.2'
compile'com.squareup.retrofit2:converter-gson:2.0.2 '
compile'com.viewpagerindicator:library:2.4.1@aar'
compile'com.google.android.gms:play-services-location:10.2.1'
compile'com .google.android.gms:play-services-maps:10.2.1'
compile'com.google.firebase:firebase-messaging:10.0.1'
compile'com.google.firebase:firebase -crash:10.0.1'
compile'com.google.code.gson:gson:2.8.0'
编译'me.dm7.barcodescanner:zbar:1.9.1'
编译'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
compile'com.android.support:support-v4:25.3.1'
testCompile'junit:junit:4.12 '
compile'io.reactivex:rxandroid:1.2.0'
compile'io.reactivex:rxjava:1.1.8'
compile'com.squareup.retrofit2:adapter-rxjava:2.1 .0'
}
a pply插件:'com.google.gms.google-services'
没有任何gradle进程问题错误..
因此在ejecuttion应用程序中有问题..因为我的buttknife没有工作注入。
也许存在版本可以和rxjava librarys一起工作吗?或版本真的很低
$ b $我的版本库 compile'com.jakewharton:butterknife:7.0.1'
解决方案
看起来您并未导入AnnotationProcessor。
试用最新版本:
compile'com.jakewharton:butterknife:8.6.0'
annotationProcessor'com.jakewharton:butterknife-compiler:8.6.0'
Have problems with two libraries.
Gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "pe.com.gmd.innova.adexus.adexusday"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
/*
greendao {
schemaVersion 7
}*/
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(name: 'androidgmd2', ext: 'aar')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'org.greenrobot:greendao:3.2.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.viewpagerindicator:library:2.4.1@aar'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.code.gson:gson:2.8.0'
compile 'me.dm7.barcodescanner:zbar:1.9.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
compile 'io.reactivex:rxandroid:1.2.0'
compile 'io.reactivex:rxjava:1.1.8'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
}
apply plugin: 'com.google.gms.google-services'
not have problems with gradle process any error..
so have problems in ejecuttion application.. because my buttknife not working injection.
Maybe exist version so working fine with rxjava librarys ? or the version is really low
my version library compile 'com.jakewharton:butterknife:7.0.1'
解决方案
It looks like you are not importing AnnotationProcessor. Try this with latest versions:
compile 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
这篇关于Buttknife不能与RXJava一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文