alibaba / alibaba/weex

weex 在android 14 系统上面因registerReceiver崩溃

Open
#3,344 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
18.5k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

compile 33, targetsdk 35,运行在android 14的系统上面崩溃:
`One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts`
分析原因应该是android 14 系统上面注册广播的时候必须用下面三个参数的方法
`public abstract Intent registerReceiver(@Nullable BroadcastReceiver receiver,
IntentFilter filter,
@RegisterReceiverFlags int flags);`
但是在weex 的0.30.2版本中WXSDKInstance类的onActivityCreateff中registerReceiver用了两个参数的方法:
try {
this.getContext().registerReceiver(this.mGlobalEventReceiver, new IntentFilter("wx_global_action"));
} catch (Throwable var2) {
Throwable e = var2;
WXLogUtils.e(e.getMessage());
this.mGlobalEventReceiver = null;
}
请问有weex android sdk的最新版本是什么版本呢,有解决这个问题吗

Contributor guide

Open the contributing guide

Research direction

Start in WXSDKInstance.onActivityCreateff, where the issue reports that mGlobalEventReceiver is registered with the two-argument registerReceiver call. Reproduce with compileSdk 33 and targetSdk 35 on Android 14, then verify the registration uses the required receiver flags and the reported crash no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.