henninghall / react-native-date-picker

React Native Date Picker is datetime picker for Android and iOS. It includes date, time and datetime picker modes. The datepicker is customizable and is supporting different languages. It's written with native code to achieve the best possible look, feel and performance.
MIT License
2.25k stars 346 forks source link

fix: RN 73 compatibility #726

Closed felipecsl closed 2 months ago

felipecsl commented 1 year ago

https://github.com/react-native-community/discussions-and-proposals/issues/671

henninghall commented 11 months ago

@felipecsl thanks a lot for the PR! 💛

  1. I don't see the gradle.properties change being mentioned in the referenced discussion, is it really needed?
  2. The unit tests are failing after this change, would you mind taking a look at it?
felipecsl commented 11 months ago

@henninghall the gradle.properties change is needed because on AGP8, BuildConfig is no longer enabled by default, which breaks the build. Adding this flag reenables it.

The unit tests are failing exactly for this reason, you need to add the same flag here https://github.com/henninghall/react-native-date-picker/blob/master/examples/Rn072/android/gradle.properties

felipecsl commented 11 months ago

There was another issue related to the namespace not matching the R class package. Just updated which should fix it

felipecsl commented 11 months ago

Updated both. Please keep in mind that this is a breaking change due to the AndroidManifest.xml change, so you'll have to bump the library major version when this is released in order to adhere to semver rules

henninghall commented 11 months ago

@felipecsl I tried the newly released version of RN 0.73 and the package seems to run fine without this fix. Do you know how to reproduce the issue?

Added an Rn073 example project in the repo.

felipecsl commented 11 months ago

Interesting. this did pop up with a project I was trying to upgrade, but we put the upgrade on hold for now so I'm no longer actively working on it. I'd say let's wait to see if more users will run into this issue, no rush to merge yet I think.

henninghall commented 11 months ago

Apparently this change doesn’t seem to be necessary, the reason is that the react native team added a backward compatibility for this, which is great.

They still recommend doing this change, but I would like to postpone is as long as possible since it introduces a breaking change and additional work of having to maintain 2 different branches of the package.

I put this PR as as draft meanwhile.

rvera commented 9 months ago

Are your fixes on the latest version? Somehow I'm still getting a Namespace not specified error.

(Trying to update to RN 73, using v4.3.5 of this lib)

felipecsl commented 9 months ago

These changes have been not merged yet, so I assume no

henninghall commented 9 months ago

@rvera could you please share an example repo where the issue is present? As far as I know RN 0.73 is supported without this PR and an example repo with RN 0.73 with the the picker is provided in the example folder of this repo.

VelocityPulse commented 7 months ago

Is this pull request abandonned ? We actually need it for React native 73

henninghall commented 7 months ago

@VelocityPulse please read comment https://github.com/henninghall/react-native-date-picker/pull/726#issuecomment-1850087497

Can you provide a repo where this is actually an issue? Then we can look into it again.

cachac commented 3 months ago

Needed for RN 73 - 74...

If you want a workaround, need to update your: gradle-wrapper.properties

Change gradle version: distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip

And prebuild (EXPO):

npx expo prebuild --no-install && npx expo run:android

henninghall commented 2 months ago

I'll close this PR until I become aware of situations where the absence of this change is an issue.