Conclusion: Restart Android Emulator with "Cold Boot Now"
Flutter Errors & Bugs Diary, May 24, 2023
When I built on the Android emulator (API 33, Pixel4), the following error appeared in the console.
E/JavaBinder( ####): !!! FAILED BINDER TRANSACTION !!! (parcel size = 412)
W/GmsClient( ####): IGmsServiceBroker.getService failed
android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died, but this could also be caused by running out of binder buffe
The app does not crash, but the AdMob ads I have implemented no longer appear.
Whether it's real or test ads, neither displays.
Does not occur on physical devices or iOS
When testing on Android physical devices or iOS simulators, this error does not appear, and ads are displayed without any problems.
Therefore, it seems that the implementation code is not the problem and it seems to be an issue with the Android emulator.
Is a lack of buffer capacity during communication the cause?
Looking at the error message, there are comments such as:
- The transaction failed
- The lack of binder buffer may be the cause
It gives the impression that it tried to receive AdMob ads, but it seems to have exceeded the capacity...
I couldn't find a clear definition of what a binder buffer is, even searching through Android's official documentation, but based on the following articles(in Japanese), it seems that Android has a buffer (buffer area) set up for communication, and there is a certain limit to its capacity... (This might be a total misunderstanding though...)
The same issue was reported
Searching the error message on the internet, I found an issue raised about the exact same situation.
Looking at the discussion, it seems to indeed be an issue with the Android emulator, and the conclusion was that the issue can be resolved by either doing "Wipe Data" or "Cold Boot Now" from Android Studio's Device Manager.
Since Wipe Data not only deletes data inside the emulator, but also resets all settings, I would prefer to avoid this if possible.
So, I shut down the emulator once, restarted it with "Cold Boot Now", and built it again. As expected, the error did not occur, and the ads were displayed.
However, when I close the app and build it again, the same error occurs again.
In the previous mentioned issue, there was a report saying, "The issue gets resolved temporarily after a cold boot of the emulator but it comes back every now and then." which seems to be the same situation.
But it's not a big hassle, so I kept repeating Cold Boot each time I built, and before I knew it, the error no longer occurred...
The AdMob ads I was displaying were always test ads, so I don't think the amount of data being sent has decreased.
I may not have completely solved the problem, but it seems like a waste of time to investigate any further... so I think I will deal with it by doing a Cold Boot if it occurs again.
Useful tools for personal app development
Recommended learning materials
＼Aiming for the campaign period can provide comprehensive content at a low cost／