question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

navigatorProvider is a restricted api

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ColtonIdlecommented, Aug 18, 2021

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 😅 )

1reaction
chrisbanescommented, Aug 17, 2021

I think you must be missing the import to androidx.navigation.plusAssign.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found