使用rxjava-的Andr​​oid问题 [英] Problems using rxjava-android

查看:880
本文介绍了使用rxjava-的Andr​​oid问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想涂在一个项目中,我有使用的gradle Rxjava。我没有任何编译错误,但是当我运行该项目我的应用程序崩溃。

I'm trying tu use Rxjava in a project that I have with gradle. I dont have any compile error, but when I run the project my app crash.

12-01 14:40:41.553    1015-1015/? I/dalvikvm﹕ Could not find method rx.Subscription.unsubscribe, referenced from method com.flipper83.protohipster.view.feed.ui.HipsterListFragment.onPause
12-01 14:40:41.553    1015-1015/? W/dalvikvm﹕ VFY: unable to resolve interface method 11579: Lrx/Subscription;.unsubscribe ()V
12-01 14:40:41.553    1015-1015/? D/dalvikvm﹕ VFY: replacing opcode 0x72 at 0x0005
12-01 14:40:41.553    1015-1015/? W/dalvikvm﹕ VFY: unable to find class referenced in signature (Lrx/Observable;)
12-01 14:40:41.565    1015-1015/? I/dalvikvm﹕ Could not find method rx.concurrency.Schedulers.newThread, referenced from method com.flipper83.protohipster.view.feed.ui.HipsterListFragment.onResume
12-01 14:40:41.565    1015-1015/? W/dalvikvm﹕ VFY: unable to resolve static method 11581: Lrx/concurrency/Schedulers;.newThread ()Lrx/Scheduler;
12-01 14:40:41.569    1015-1015/? D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0014
12-01 14:40:41.569    1015-1015/? I/dalvikvm﹕ Failed resolving Lcom/flipper83/protohipster/view/feed/ui/HipsterListFragment$1; interface 2027 'Lrx/Observer;'
12-01 14:40:41.569    1015-1015/? W/dalvikvm﹕ Link of class 'Lcom/flipper83/protohipster/view/feed/ui/HipsterListFragment$1;' failed
12-01 14:40:41.569    1015-1015/? D/dalvikvm﹕ DexOpt: unable to opt direct call 0x148a at 0x1e in Lcom/flipper83/protohipster/view/feed/ui/HipsterListFragment;.onResume
12-01 14:40:41.577    1015-1015/? W/dalvikvm﹕ VFY: unable to find class referenced in signature (Lrx/Observer;)
12-01 14:40:41.577    1015-1015/? W/dalvikvm﹕ VFY: unable to find class referenced in signature (Lrx/Observer;)
12-01 14:40:41.577    1015-1015/? I/dalvikvm﹕ Could not find method rx.Observer.onNext, referenced from method com.flipper83.protohipster.view.feed.model.FeedViewModel.notifyFeed
12-01 14:40:41.577    1015-1015/? W/dalvikvm﹕ VFY: unable to resolve interface method 11578: Lrx/Observer;.onNext (Ljava/lang/Object;)V
12-01 14:40:41.577    1015-1015/? D/dalvikvm﹕ VFY: replacing opcode 0x72 at 0x0028
12-01 14:40:41.577    1015-1015/? I/dalvikvm﹕ Failed resolving Lcom/flipper83/protohipster/view/feed/model/FeedViewModel$1; interface 2025 'Lrx/Observable$OnSubscribeFunc;'
12-01 14:40:41.577    1015-1015/? W/dalvikvm﹕ Link of class 'Lcom/flipper83/protohipster/view/feed/model/FeedViewModel$1;' failed
12-01 14:40:41.577    1015-1015/? E/dalvikvm﹕ Could not find class 'com.flipper83.protohipster.view.feed.model.FeedViewModel$1', referenced from method com.flipper83.protohipster.view.feed.model.FeedViewModel.populateFeed
12-01 14:40:41.581    1015-1015/? W/dalvikvm﹕ VFY: unable to resolve new-instance 794 (Lcom/flipper83/protohipster/view/feed/model/FeedViewModel$1;) in Lcom/flipper83/protohipster/view/feed/model/FeedViewModel;
12-01 14:40:41.581    1015-1015/? D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
12-01 14:40:41.581    1015-1015/? I/dalvikvm﹕ Failed resolving Lcom/flipper83/protohipster/view/feed/model/FeedViewModel$1; interface 2025 'Lrx/Observable$OnSubscribeFunc;'
12-01 14:40:41.581    1015-1015/? W/dalvikvm﹕ Link of class 'Lcom/flipper83/protohipster/view/feed/model/FeedViewModel$1;' failed
12-01 14:40:41.581    1015-1015/? D/dalvikvm﹕ DexOpt: unable to opt direct call 0x145d at 0x02 in Lcom/flipper83/protohipster/view/feed/model/FeedViewModel;.populateFeed
12-01 14:40:41.585    1015-1015/? D/AndroidRuntime﹕ Shutting down VM
12-01 14:40:41.585    1015-1015/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xa62ca288)
12-01 14:40:41.585    1015-1015/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: com.flipper83.protohipster.view.feed.model.FeedViewModel$1
            at com.flipper83.protohipster.view.feed.model.FeedViewModel.populateFeed(FeedViewModel.java:43)

我认为问题来自gradle这个。这是我的build.xml的gradle

I believe that the problem comes from gradle. this is my gradle build.xml.

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
    flatDir {
        dirs 'lib'
    }
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
    }

    sourceSets {
        main {
            assets.srcDirs = ['assets']
        }
    }

}

dependencies {
    compile 'com.squareup.picasso:picasso:2+'
    compile 'com.squareup.dagger:dagger-compiler:1.1.0'
    compile 'com.squareup.dagger:dagger:1.1.0'
    compile 'com.android.support:support-v4:18.0.+'
    compile 'com.squareup.retrofit:retrofit:1.2.+'
    compile 'com.netflix.rxjava:rxjava-android:0.14.+'
    compile files('lib/Parse-1.3.8.jar')
}

任何想法??

推荐答案

是的,我有固定的:

compile 'com.netflix.rxjava:rxjava-core:0.+'
compile 'com.netflix.rxjava:rxjava-android:0.+'
compile 'com.squareup.retrofit:retrofit:1.5.0'

在我的的build.gradle

感谢您

这篇关于使用rxjava-的Andr​​oid问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆