-
Notifications
You must be signed in to change notification settings - Fork 535
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
Fix : #5405 Feature/replace deprecated bundle calls #5611
base: develop
Are you sure you want to change the base?
Fix : #5405 Feature/replace deprecated bundle calls #5611
Conversation
…r SDK 33+ compatibility
Hey @adhiamboperes , I'm reaching out because I encountered a couple of issues after updating the AndroidX dependencies, and I would appreciate your assistance in resolving them. 1. Duplicate Content Roots ErrorAfter updating the dependencies, I received the following error when attempting to run the app:
It appears to be related to duplicate module paths, but I'm unsure about the appropriate steps to resolve this. Could you please provide some guidance on how to address this issue? 2. Gradle Duplicate Entry ErrorIn addition, during the Running process, I encountered the following error: Caused by: org.gradle.api.InvalidUserCodeException: Entry arguments.proto is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.6/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details. From my understanding, this is related to duplicate file handling in the Gradle build process. However, I’m uncertain about how to configure it correctly to resolve the issue. Any advice or recommendations would be extremely helpful. Thanks !! |
Hi @TanishMoral11, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Hi @TanishMoral11, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Hi @TanishMoral11, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Hi @TanishMoral11, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Explanation
Fix #5405 : This PR addresses the deprecation of certain
Bundle
methods in Android API level 33, as detailed in Feature Request #5405. Specifically, it replaces the usage of deprecated, type-ambiguousBundle
calls with type-safe alternatives from theBundleCompat
class, which ensures compatibility with the updated Android API.Changes Made:
Refactor of Bundle method calls:
Bundle.get()
andBundle.getSerializable()
calls have been replaced withBundleCompat.get()
andBundleCompat.getSerializable()
respectively, using type-safe methods that are now required by API 33 and above.Refactor of helper methods:
getTypedSerializable()
method inBundleExtensions.kt
has been removed since it essentially reimplemented theBundleCompat.getSerializable()
method. This reduces redundancy and ensures that the code uses the built-in methods ofBundleCompat
for serializable objects.Additional Changes:
getSerializable()
calls withBundleCompat.getSerializable()
.get()
calls with type-specific methods (e.g.,getString()
,getInt()
).getTypedSerializable()
helper method to useBundleCompat
.OptionsActivity.kt
TestFontScaleConfigurationUtilActivity.kt
TopicPracticeFragment.kt
BundleExtensions.kt
BundleExtensionsTest.kt
These changes were made to ensure compatibility with Android API level 33 (and later), which deprecated certain
Bundle
methods in favor ofBundleCompat
methods, specifically for better handling of type-specific data.Testing:
BundleExtensionsTest.kt
to ensure correct usage of the new type-safe methods.This PR addresses part of issue #5405 by ensuring that all deprecated
Bundle
method calls are replaced and the app continues to function smoothly on API 33 and later.Essential Checklist