Skip to content
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 error of adding final before context in setButtonTextColor method in Common.java android #723

Merged
merged 1 commit into from Feb 12, 2023

Conversation

iamsaadMehmood
Copy link
Contributor

@iamsaadMehmood iamsaadMehmood commented Feb 10, 2023

Summary
The Fix is required in the common.java file.
After installing the following error occurs in android while running the application:

Task :react-native-community_datetimepicker:compileDebugJavaWithJavac FAILED
168 actionable tasks: 161 executed, 7 up-to-date
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Note: /Users/developer/Documents/PersonalProjects/projectName-/node_modules/lottie-react-native/src/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/developer/Documents/PersonalProjects/projectName-/node_modules/lottie-react-native/src/android/src/main/java/com/airbnb/android/react/lottie/LottieAnimationViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
/Users/developer/Documents/PersonalProjects/projectName-/node_modules/@react-native-community/datetimepicker/android/src/main/java/com/reactcommunity/rndatetimepicker/Common.java:76: error: local variable activityContext is accessed from within inner class; needs to be declared final
int textColorPrimary = getDefaultDialogButtonTextColor(activityContext);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

So I fixed the error by adding "final" in the method and attach the PR.

@iamsaadMehmood iamsaadMehmood changed the title fix error of adding final before context on android fix error of adding final before context in setButtonTextColor method in Common.java android Feb 10, 2023
@vonovak vonovak merged commit 490dead into react-native-datetimepicker:master Feb 12, 2023
@vonovak
Copy link
Member

vonovak commented Feb 12, 2023

thank you! 🙂

@iamsaadMehmood
Copy link
Contributor Author

My pleasure 🤗

@bhavzie
Copy link

bhavzie commented Feb 14, 2023

Thanks for this!

@iamsaadMehmood
Copy link
Contributor Author

Thanks for this!

You are welcome🤗

vonovak pushed a commit that referenced this pull request Feb 14, 2023
## [6.7.5](v6.7.4...v6.7.5) (2023-02-14)

### Bug Fixes

* **android:** mark context as final ([#723](#723)) ([490dead](490dead))
@vonovak
Copy link
Member

vonovak commented Feb 14, 2023

🎉 This issue has been resolved in version 6.7.5 🎉

If this package helps you, consider sponsoring us! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants