Comments (4)
问题稍微有点模糊,麻烦根据下面几个步骤确认下:
0、发一下跳转部分的代码
1、检查build文件下生成的对应代码, 根据经验判断有没问题(也可以发出来)
2、查看注入点是否忘记调用ARouter.getInstance().inject(this); 注入
3、更换mUrls模块的注解处理器为原生注解处理器, 然后看是否存在问题
4、将mUrls替换为MutableList, 看是否存在问题
from arouterkspcompiler.
貌似确实会出问题, 代码生成中区分了11中数据类型,8种基础类型Parcelable和Serializable, Object类(走Json解析方案,包括ArrayList等), 因此需要使用withObject传递参数
Arouter使用withObject传参需要自定义序列化工具:
参考:https://github.com/alibaba/ARouter#iv-advanced-usage
// If you need to pass a custom object, Create a new class(Not the custom object class),implement the SerializationService, And use the @Route annotation annotation, E.g:
@Route(path = "/yourservicegroupname/json")
public class JsonServiceImpl implements SerializationService {
@Override
public void init(Context context) {
}
@Override
public <T> T json2Object(String text, Class<T> clazz) {
return JSON.parseObject(text, clazz);
}
@Override
public String object2Json(Object instance) {
return JSON.toJSONString(instance);
}
}
另外, 如果使用json方式完成对象解析, 如果字段内容为空可能会导致崩溃, 我会立即修复这个问题
from arouterkspcompiler.
请去README更新最新版本(xxx-1.0.2), 按照withObject传递参数即可, 可以去参考app模块的跳转传参示例😘
from arouterkspcompiler.
好的。 谢谢大佬
from arouterkspcompiler.
Related Issues (12)
- 能支持AGP7.3吗? HOT 1
- 请教一下作者 HOT 5
- 为什么会有kotlin1.7.22这个版本 HOT 1
- 关于Arouter 使用ksp 后,无法覆盖以前使用Kapt 编译的APP HOT 4
- Type in a class literal must not be nullable HOT 10
- 使用withStringArrayList在接收参数地方会出现One type argument expected for typealias ArrayList<E> = ArrayList<E> HOT 7
- 大佬啥时候kt升到1.8.10啊 HOT 2
- 能支持下java11么? HOT 9
- [ksp] No providers found in processor classpath HOT 2
- 在泛型类使用 @Autowired 注解编译报错 HOT 2
- ksp 最新版本 HOT 17
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 arouterkspcompiler.