react-native-date-picker icon indicating copy to clipboard operation
react-native-date-picker copied to clipboard

fix: RN 73 compatibility

Open felipecsl opened this issue 2 years ago • 13 comments

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

felipecsl avatar Nov 16 '23 18:11 felipecsl

@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?

henninghall avatar Dec 03 '23 16:12 henninghall

@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 avatar Dec 03 '23 21:12 felipecsl

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

felipecsl avatar Dec 03 '23 21:12 felipecsl

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

felipecsl avatar Dec 03 '23 21:12 felipecsl

@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.

henninghall avatar Dec 07 '23 11:12 henninghall

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.

felipecsl avatar Dec 07 '23 11:12 felipecsl

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.

henninghall avatar Dec 11 '23 13:12 henninghall

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)

rvera avatar Feb 06 '24 00:02 rvera

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

felipecsl avatar Feb 06 '24 03:02 felipecsl

@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.

henninghall avatar Feb 12 '24 12:02 henninghall

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

VelocityPulse avatar Apr 11 '24 12:04 VelocityPulse

@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.

henninghall avatar Apr 12 '24 08:04 henninghall

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

cachac avatar Aug 03 '24 21:08 cachac