解决You should manually set the same version via DependencyResolution问题.

本文记录了一次解决Android项目中RxJava及RxAndroid版本冲突的过程。作者最初遇到编译时和运行时版本不一致的问题,在尝试多种解决方案无效后,通过更新RxJava版本至稳定版最终解决了该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.前几天添加了最新版本号为2.1.14-RC1的RxJava的依赖

2.今天去添加Rx生命周期的依赖库


3.添加完点击Sync Now,出现如下错误提示:

Error:Execution failed for task ':app:preDebugBuild'.
> Android dependency 'io.reactivex.rxjava2:rxandroid' has different version for the compile (2.0.1) and runtime (2.0.2) classpath. You should manually set the same version via DependencyResolution(和下图报错显示一致哈)

4.在网上搜了好几种方式,都试了下,无果..

第一种尝试:

添加 subprojects 下面的代码块到project的build.gradle 文件,再Clean and Build again,我没有成功,报错依旧..

allprojects {
    repositories {
       //...
    }

    subprojects {
        project.configurations.all {
            resolutionStrategy.eachDependency { details ->
                if (details.requested.group == 'com.android.support'
                && !details.requested.name.contains('multidex') ) {
                    details.useVersion "25.4.0"
                }
            }
        }
    }
}

第二种尝试:

包重复,剔除即可.然而我并没有在我的项目中找到重复的..

......


最后的解决方法:

Github上看RxJava的版本号,由几天前的2.1.14-RC1改为了2.1.14,ok,将项目中的版本号修改如下图,再Sync Now,报错就不见了!!



??我的疑问??

后来不明所以的我又用清奇的脑回路把版本号换回了2.1.14-RC1,Sync Now之后,又不报错了!!现在无论使用2.1.14还是2.1.14-RC1都是正常的,Why?!

哪位大神知道原因,请指点下,谢谢!

### Keil C51 Software Configuration and Settings Guide For configuring the Keil C51 development environment, several critical aspects need attention to ensure that projects compile correctly and efficiently. The setup involves creating a new project, setting up target options, including paths for external libraries or include files, selecting appropriate device parameters, and ensuring correct linker configurations. #### Creating a New Project To start with a fresh project within Keil C51: A dialog appears where one can specify the name of the project along with its location on disk[^1]. ```c // Example code snippet showing initialization routine which might be part of your main function. void main(void){ // Initialization routines here... } ``` #### Setting Target Options Under 'Target' tab settings, it is essential to define specific microcontroller details such as model type (e.g., AT89C51), crystal oscillator frequency used by hardware since timing-sensitive operations depend heavily upon this value being set accurately. #### Configuring Include Paths and Libraries When incorporating additional source codes from different directories or utilizing third-party library functions not included directly inside standard headers provided by default installation package; under "Options for Target" -> "C51", add necessary directory locations into `Include Path` field separated using semicolons (;). Similarly, any required object (.obj) or archive (.lib) should also get listed appropriately so they are accessible during compilation/linking stages. #### Selecting Device Parameters Choosing an accurate MCU variant plays a crucial role because each has unique characteristics like memory layout, interrupt vectors mapping etcetera – all affecting how generated machine instructions interact at runtime level effectively without causing conflicts due mismatched expectations between software design assumptions versus actual physical capabilities offered by chosen silicon chip implementation. #### Linker Configuration Finally, adjusting link-time optimizations through specifying startup files (`STARTUP.A51`) ensures proper execution flow control starting point while managing stack size allocation according to application requirements prevents potential overflow issues leading towards unpredictable behavior patterns observed otherwise unexpectedly when running embedded applications built atop resource-constrained platforms especially those based around 8-51 family represents historically speaking today still widely utilized across various industries ranging consumer electronics automotive controls industrial automation systems among others. --related questions-- 1. What are some common pitfalls encountered during initial configuration? 2. How does one optimize their build process in terms of speed and output file sizes? 3. Can you provide tips for debugging problems related specifically to incorrect settings within Keil C51 IDE interface elements discussed above? 4. Are there alternative methods available besides manually editing these fields every time changes occur frequently throughout development cycles involving multiple iterations over same base codebase structure repeatedly overtime continuously constantly regularly habitually persistently steadfastly unwaveringly unswervingly unfalteringly resolutely determinededly? 5. Is it possible integrate version control system hooks/scripts alongside automated testing frameworks seamlessly together cohesively holistically synergistically collaboratively cooperatively harmoniously compatibly interoperably within workflow processes managed via Keil's toolchain ecosystem infrastructure support mechanisms features functionalities utilities tools resources assets properties attributes characteristics traits qualities? Note: There seems to have been confusion regarding USB VID & PID table mentioned initially but later asked about Keil C51 configuration instead - perhaps two separate queries intended originally?
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值