Comments (10)
什么情况下出现此问题?打包后?把module结构,及RxHttp依赖配置截图发出
from rxhttp.
在Java还是kotlin环境中调用?依赖的kotlin版本又是多少
from rxhttp.
在kotlin 环境下调用的,kotlin版本为1.9.20 。在调试环境下,运行后调用rxhttp请求网络时出现的
from rxhttp.
把kotlin版本改为1.9.10
,ksp改为1.9.10-1.0.13
再试试,还是不行话,加我微信 ljx-studio
from rxhttp.
好的我先试一下再过来回复
from rxhttp.
你好,还是不行加你微信了
from rxhttp.
问题已找到,原因是,rxhttp-compiler
的kapt注解处理器
跟hilt
有点冲突,即使使用ksp
依赖rxhttp-compiler
,hilt依然会调用rxhttp-compiler
的kapt注解处理器去生成Java版本的RxHttp类,而
ksp依赖
rxhttp-compiler,又会生成一份kotlin版本
RxHttp`类,如下图所示:
导致在代码合并时,把kotlin版本的RxHttp类丢失了,而Java版本的RxHttp类,是没有RxHttp$Companion
变量的,所以就报错了,下个版本会规避这个问题
from rxhttp.
在已使用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.
注:使用kapt依赖rxhttp-compiler
没有此问题
from rxhttp.
from rxhttp.
Related Issues (20)
- 用Java自定义解析器,wrappers参数传入`List.class`,ksp编译后BaseRxHttp类报错 HOT 1
- JSON日志显示问题 HOT 2
- toDownloadFlow点击Cannot find declaration to go to HOT 5
- rxhttp最低支持的gradle和kotlin版本是多少 HOT 6
- 自动刷新问题 HOT 1
- Cannot resolve symbol 'RxHttp' HOT 9
- 下载文件可能会超时,怎么解决? HOT 2
- 打印日志添加缓存信息 HOT 1
- 有时候后台会返回一些意想不到的json HOT 11
- 编译报错了 HOT 5
- 关于后端接口数据返回null,但是接口成功自定义Parser的问题 HOT 5
- RxHttp 生成在 AndroidTest 目录 HOT 3
- ksp编译,未使用任何注解,随意更改子module中的代码,运行项目,编译报错,提示找不到RxHttp类 HOT 1
- 服务器返回数据特殊处理 HOT 6
- 打印日志是有长度限制吧?请求参数过长日志打印不全,建议提供方法设置可控制 HOT 2
- 不能直接得到Response吗 HOT 3
- java.lang.NullPointerException: <get-cache>(...) must not be null 这种一般是什么问题呀,不是必现,偶尔出现就会闪退。 HOT 3
- 自定义parser生成失败 HOT 7
- 关于默认域名的问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxhttp.