-
Notifications
You must be signed in to change notification settings - Fork 602
StrictMode policy violation: android.os.strictmode.UnbufferedIoViolation
when upgrading to targetSdkVersion 34
#6564
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
Comments
I found a few problems with this issue:
|
previously dismissed here, I'm sure you'll get more reports as more developers need to start upgrading target sdk |
Hi @gubatron, thank you for reporting the issue and submitting a pull request. I'll inform our engineers about the PR for review. Thanks! |
Hi @gubatron, I took a look at this. I am not seeing the strict mode violation in my own test app. I am not sure what conditions are required to reproduce it, could you please provide a MCVE? Your PR looks fine, I will be happy to review it once I can reproduce the issue. |
Oh so nice to get a response. This is how I was setting strictPolicy mode on: static void setStrictPolicy(boolean enable) {
LOG.info("RunStrict.setStrictPolicy(" + enable + ") Debug.isEnabled()=" + Debug.isEnabled());
if (!Debug.isEnabled()) {
LOG.info("StrictMode is disabled, this is a DEBUG build");
return; // no debug mode, do nothing
}
// by default, the LAX policy
StrictMode.ThreadPolicy threadPolicy = StrictMode.ThreadPolicy.LAX;
StrictMode.VmPolicy vmPolicy = StrictMode.VmPolicy.LAX;
if (enable) {
threadPolicy = new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.penaltyDeath()
.build();
vmPolicy = new StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog()
.penaltyDeath()
.setClassInstanceLimit(Engine.class, 1)
.build();
}
StrictMode.setThreadPolicy(threadPolicy);
StrictMode.setVmPolicy(vmPolicy);
} If I call |
I was able to reproduce your issue and review your PR. It LGTM. I am not sure if you'll have to jump through hoops to merge it, let me know if you run into any problems.
There are only a few of us working on this, relax. |
Hey @gubatron. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
dear bot, the issue has been replicated, and the patch looks good. |
Hi @gubatron, it looks like there is an issue in the CLA. You would need to accept the CLA to merge the PR. Could you confirm if you have accepted the CLA? |
Hey @lehcar09 I believe I've contributed several patches before to open source Google projects, I signed the Google Contributor License Agreement back in 2014 I just updated it to now have my github username, perhaps that was the issue? Is there another one for Firebase I need to sign? please send link. |
The CLA you signed is the right one. I'll raise this to our engineer and see if we can merge the PR on your behalf. Thanks! |
Hey @gubatron, per checking with our Engineers, you need to do some extra steps. Could you try the steps mentioned here #6565 (comment)? Also, please update the base branch to align with the current branch. Let me know how it goes. |
sorry for the delay, out of the country at the moment on vacation |
I think I've done that last step with the google-services.json and a repo secret |
[REQUIRED] Step 2: Describe your environment
com.google.firebase:firebase-bom:33.7.0
,com.google.firebase:firebase-crashlytics
[REQUIRED] Step 3: Describe the problem
Firebase crashlytics incurrs in an Unbuffered IO Violation when building our app for target SDK 34 upon loading the library on app startup.
Steps to reproduce:
Start the app, this comes out in the logs:
Relevant Code:
In your
SessionReportingCoordinator.java
you're not using Buffered IO:Your code should be more like this to avoid the triggers in Android 14+
The text was updated successfully, but these errors were encountered: