Giter Club home page Giter Club logo

Comments (10)

liujingxing avatar liujingxing commented on June 30, 2024

什么情况下出现此问题?打包后?把module结构,及RxHttp依赖配置截图发出

from rxhttp.

liujingxing avatar liujingxing commented on June 30, 2024

在Java还是kotlin环境中调用?依赖的kotlin版本又是多少

from rxhttp.

q947721485 avatar q947721485 commented on June 30, 2024

在kotlin 环境下调用的,kotlin版本为1.9.20 。在调试环境下,运行后调用rxhttp请求网络时出现的
WechatIMG1
WechatIMG2
WechatIMG3
WechatIMG4
WechatIMG5
WechatIMG6
WechatIMG7

from rxhttp.

liujingxing avatar liujingxing commented on June 30, 2024

把kotlin版本改为1.9.10,ksp改为1.9.10-1.0.13再试试,还是不行话,加我微信 ljx-studio

from rxhttp.

q947721485 avatar q947721485 commented on June 30, 2024

好的我先试一下再过来回复

from rxhttp.

q947721485 avatar q947721485 commented on June 30, 2024

你好,还是不行加你微信了

from rxhttp.

liujingxing avatar liujingxing commented on June 30, 2024

问题已找到,原因是,rxhttp-compilerkapt注解处理器hilt有点冲突,即使使用ksp依赖rxhttp-compiler,hilt依然会调用rxhttp-compilerkapt注解处理器去生成Java版本的RxHttp类,而ksp依赖rxhttp-compiler,又会生成一份kotlin版本RxHttp`类,如下图所示:
image

导致在代码合并时,把kotlin版本的RxHttp类丢失了,而Java版本的RxHttp类,是没有RxHttp$Companion变量的,所以就报错了,下个版本会规避这个问题

from rxhttp.

liujingxing avatar liujingxing commented on June 30, 2024

在已使用ksp依赖rxhttp-compiler的情况下,复现步骤如下
1、在项目的build.gradle文件中添加一下代码

buildscript {

    dependencies {
        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.48.1'
    }
}

plugins {
    id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false
}

2、在module的build.gradle文件中添加以下代码

plugins {
    id 'dagger.hilt.android.plugin'
}

dependencies {
    implementation "com.google.dagger:hilt-android:2.48.1"
    ksp "com.google.dagger:hilt-android-compiler:2.48.1"  //kapt或ksp一样有问题
}

3、使用hilt任一注解,如:

@HiltAndroidApp
public class AppHolder extends Application {
    //省略部分代码
}

项目同步成功后,rebuild一下项目,此时就会出现两个RxHttp类

from rxhttp.

liujingxing avatar liujingxing commented on June 30, 2024

注:使用kapt依赖rxhttp-compiler没有此问题

from rxhttp.

liujingxing avatar liujingxing commented on June 30, 2024

v3.2.4版本已解决该问题

from rxhttp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.