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

androidx.test.internal.runner.InstrumentationConnection.init error in androidU #1907

Open
fanluo opened this issue Aug 30, 2023 · 1 comment

Comments

@fanluo
Copy link

fanluo commented Aug 30, 2023

Description

In androidU,if the app target is 34 , when we registerReceiver,we must use the RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED flag , but the class InstrumentationConnection did not do this when it int.
so my app is crash on androidU devices

the error code in InstrumentationConnection is on line 173
targetContext.registerReceiver(messengerReceiver, new IntentFilter(BROADCAST_FILTER));

Expected Results

I want the class InstrumentationConnection on line 173 like this:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
targetContext.registerReceiver(messengerReceiver, new IntentFilter(BROADCAST_FILTER),Context.RECEIVER_EXPORTED);
} else {
targetContext.registerReceiver(messengerReceiver, new IntentFilter(BROADCAST_FILTER));
}

Link to a public git repo demonstrating the problem:

https://developer.android.google.cn/guide/components/broadcasts#context-registered-receivers

@brettchabot
Copy link
Collaborator

Can you provide more details? What versions of the libraries are you using, ideally a complete sample project. We have many passing tests that target and run on android U

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

No branches or pull requests

2 participants