Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]能提供一个适配了Android 15 16KB的版本吗 #1353

Open
lukezhu2023 opened this issue Jul 12, 2024 · 15 comments
Open
Labels
enhancement New feature or request

Comments

@lukezhu2023
Copy link

https://developer.android.com/guide/practices/page-sizes?hl=zh-cn

@lingol lingol changed the title 能提供一个适配了Android 15 16KB的版本吗 [Feature Request]能提供一个适配了Android 15 16KB的版本吗 Jul 12, 2024
@lingol lingol added the enhancement New feature or request label Jul 12, 2024
@lingol
Copy link
Collaborator

lingol commented Jul 12, 2024

I understand that using 16K Pagesize will enhance memory efficiency (iOS uses 16K for a loooong time).

I have taken a quick look at the docs you posted. Looks like that requires an upgrade on NDK & AGP, and a complete review on the core source code on Pagesize. That's a lot of work.

So it won't be soon.

@kaitian521
Copy link
Contributor

https://github.com/search?q=repo%3ATencent%2FMMKV%204096&type=code

maybe all is right in 16K pagesize

@lingol
Copy link
Collaborator

lingol commented Jul 12, 2024

https://github.com/search?q=repo%3ATencent%2FMMKV%204096&type=code

maybe all is right in 16K pagesize

Maybe.

The AGP plugin update is yet another painful job. Last time I did it the publish-to-maven script was broken and had to rollback.

@lukezhu2023
Copy link
Author

@lingol 能直接使用NDK 或者cmake编译 出so库吗?这样就可以不升级AGP?

@lingol
Copy link
Collaborator

lingol commented Jul 16, 2024

@lingol 能直接使用NDK 或者cmake编译 出so库吗?这样就可以不升级AGP?

Maybe. It's not in our top priority though. I have checked with some senior Android devs and find out that no major brands turn on 16K on Android 15.

@Nullifier1571
Copy link

尊敬的开发者:
您好!目前小米已发布了Android 15预览版,开放平台也同步上线了带有新系统的远程真机,请开发者启动适配工作,并于2024年8月31日之前完成适配!
若您在2024年8月31日前未进行处理,我们将按照产品对用户的影响程度,采取相关措施以保障用户使用体验,包括但不限于“搜索标签提示”、“应用降级”、“分机型屏蔽”、“应用下架”。 请各位开发者及时调整,小米与您一起建设更好的Android 生态。

咨询了下小米工程师年内可能没计划进行16k对齐但是还是推荐先提前做好对齐工作,其他厂商还不了解。目前我们应用使用了mmkv在谷歌提供的模拟器上必崩。

java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~NHViVslYBhncFDynZV6M9A==/com.wuba-Ll6_cDr4REu_oyprb9oFFg==/lib/arm64/libmmkv.so" (new hash type from the future?)

@lingol
Copy link
Collaborator

lingol commented Jul 17, 2024

new hash type from the future?

Looks like a bug in the system image. MMKV is built with NDK26, so no way has anything from the future.
May I suggest you make a bug report to the Google team?

@Nullifier1571
Copy link

可以参考
https://github.com/Tencent/MMKV/wiki/android_setup_cn
https://developer.android.com/guide/practices/page-sizes?hl=zh-cn#cmake
编译一个支持16k的aar,目前我已经解决了该问题

@lingol
Copy link
Collaborator

lingol commented Jul 17, 2024

@Nullifier1571 that's good to know, thank you.

@lukezhu2023
Copy link
Author

可以参考 https://github.com/Tencent/MMKV/wiki/android_setup_cn https://developer.android.com/guide/practices/page-sizes?hl=zh-cn#cmake 编译一个支持16k的aar,目前我已经解决了该问题

你好,你是编译了一个支持16KB的MMKV版本了吗?方便共享吗?另外我看官方文档还是要改写代码的,比如代码里写死了4096的地方

@Nullifier1571
Copy link

https://github.com/Nullifier1571/mmkvaar/

lingol added a commit that referenced this issue Jul 23, 2024
@fanlb
Copy link

fanlb commented Aug 14, 2024

了解的片面了, 适配android最新版本特性, 几乎是每个移动端团队每年必做的事情, 对现有app产生crash的变动 更会格外重视

@lingol能直接使用NDK或者cmake编译出so库吗?这样就可以不升级AGP吗?

也许吧。不过这并不是我们的首要任务。我咨询了一些资深 Android 开发人员,发现没有哪个大品牌会在 Android 15 上启用 16K。

@lingol
Copy link
Collaborator

lingol commented Aug 14, 2024

Just so all you know, 16K is supported in the dev branch and will be available in the next version v2.0.

@mrousavy
Copy link
Contributor

Nice work @lingol !

@jzlhll
Copy link

jzlhll commented Sep 15, 2024

https://github.com/Nullifier1571/mmkvaar/

用着用着出现了 库的奔溃。

logging.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants