Android icon indicating copy to clipboard operation
Android copied to clipboard

Remove APIs deprecated in Android 15

Open TheLastProject opened this issue 11 months ago • 2 comments

Google Play is complaining about this. Mindlessly removing it hasn't worked (because it breaks Android 14 stuff) so we need to look at what we can do:

Your app uses deprecated APIs or parameters for edge-to-edge

One or more of the APIs you use or parameters that you set for edge-to-edge and window display have been deprecated in Android 15. Your app uses the following deprecated APIs or parameters:

android.view.Window.setDecorFitsSystemWindows androidx.core.view.WindowCompat$Api35Impl.setDecorFitsSystemWindows androidx.core.view.WindowCompat.setDecorFitsSystemWindows android.view.Window.setStatusBarColor android.view.Window.setNavigationBarColor com.yalantis.ucrop.UCropActivity.setStatusBarColor com.yalantis.ucrop.UCrop$Options.setStatusBarColor

These start in the following places:

androidx.core.view.WindowCompat$Api35Impl.setDecorFitsSystemWindows androidx.core.view.WindowCompat.setDecorFitsSystemWindows com.google.android.material.internal.EdgeToEdgeUtils.applyEdgeToEdge com.yalantis.ucrop.UCropActivity.setStatusBarColor com.yalantis.ucrop.UCropActivity.setupAppBar protect.card_locker.CatimaAppCompatActivity.onPostCreate protect.card_locker.LoyaltyCardEditActivity.setCropperOptions protect.card_locker.LoyaltyCardViewActivity$$ExternalSyntheticApiModelOutline1.m protect.card_locker.Utils.setNavigationBarColor

To fix this, migrate away from these APIs or parameters.

(Of course, the com.yalantis.ucrop we can't do anything about, that's part of https://github.com/Yalantis/uCrop. We may need to pick a different library if they don't fix their side)

TheLastProject avatar Jan 16 '25 21:01 TheLastProject

It seems that uCrop is broken on Android 15 and displays the save button on the title bar. That's not great.

https://github.com/jens-muenker/uCrop-n-Edit seems to be a more maintained fork, investigate switching to that.

TheLastProject avatar Jan 16 '25 22:01 TheLastProject

#2378 works well enough for now, but uCrop should probably still be replaced. And cleaning up these APIs where possible are probably still a good idea for long-term maintainability.

TheLastProject avatar Mar 23 '25 10:03 TheLastProject