-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
StrictMode: StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation
in MainActivity.onCreate
#148268
Comments
Hi @lukehutch, it appears that this warning can be ignored. Please see the links below. #36915 (comment) Do they affect your app ? |
@danagbemava-nc Thanks for the links. The app is operating OK, but I assumed this was a warning that an API would be locked down in the future against reflection or something, and if the API is not fixed, it will then break (Java did this when they started enforcing strict encapsulation). Maybe change the text of the error to give a slightly less scary-looking warning, that explains the actual problem? |
This comes from the android system itself so I'm not sure we can modify that warning.
My reading of this was, we're using an API that does not come with the sdk itself. I assume the API is still relevant and exists but it is just not packaged with the standard android sdk.
Can you share some links to this? This might be worth looking into further. Thank you |
This is for JVM environments, not Dalvik. Strong encapsulation is a feature of the Java module system for JDK 9+, but I'm pretty sure Android isn't using this as a security mechanism, or at least not to report the errors that I reported in this issue. Here's the link since you asked, even if it's probably not relevant: https://dev.java/learn/modules/strong-encapsulation/ I'll go ahead and close this since it seems like there's nothing that can be done about this. Thanks! |
Steps to reproduce
I get a lot of
StrictMode: StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation
exceptions inMainActivity.onCreate
.Expected results
--
Actual results
See log below
Code sample
Code sample
My
MainActivity.onCreate
is just:Screenshots or Video
N/A
Logs
Logs
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: