navigatorProvider is a restricted api
See original GitHub issueI used Jossi’s article to implement a bottom sheet but it’s now failing lint.
NavController.setNavigatorProvider can only be called from within the same library group (referenced groupId=androidx.navigation from groupId=src)
val navController = rememberNavController()
val bottomSheetNavigator = rememberBottomSheetNavigator()
navController.navigatorProvider += bottomSheetNavigator
This API has been flagged with a restriction that has not been met.
Examples of API restrictions:
* Method can only be invoked by a subclass
* Method can only be accessed from within the same library (defined by the Gradle library group id)
* Method can only be accessed from tests.
You can add your own API restrictions with the @RestrictTo annotation.
To suppress this error, use the issue id "RestrictedApi" as explained in the Suppressing Warnings and Errors section.
RestrictedApi Correctness Error Priority 4/10
Should I be using a different api or something?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
NavigatorProvider - Android Developers
Restrictions on starting activities from the background. Discover the latest app development tools, platform updates, training, and documentation for ...
Read more >Warning: NavController.setNavigatorProvider can only be ...
Show activity on this post. You might avoid warning using the below code: navController.navigatorProvider.addNavigator(navigator).
Read more >Provide a Navigation Compose API for correctly adding a ...
It's my understanding that when using a custom Navigator, this should be added to NavController via SideEffect. However, doing so produces IllegalStateException ...
Read more >wordpress/api-fetch | Block Editor Handbook
Utility to make WordPress REST API requests. ... If you're using an environment that has limited or no support for such language features...
Read more >Remediation for exposed GCP API keys - Google Help
Add restrictions to your API key so that only your apps are allowed to use the API key. More details on adding restrictions...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Lint issue filed: https://issuetracker.google.com/issues/197123294
Going to close this since it seems like it’s nothing related to accompanist. (Edit: Actually it’s already closed 😅 )
I think you must be missing the import to
androidx.navigation.plusAssign
.