react-native-blob-util icon indicating copy to clipboard operation
react-native-blob-util copied to clipboard

NEED A UPDATE

Open Kevinhellomove opened this issue 1 year ago • 18 comments

For working with new React-native and expo version we need an update because now dependencys are working for old versions.

Kevinhellomove avatar Nov 15 '24 09:11 Kevinhellomove

Do you hava little more information for me maybe? What exactly is needed?

RonRadtke avatar Nov 15 '24 09:11 RonRadtke

The peer dependencies of the library refer to older versions of react native and expo which generates problems when working with the new versions and new architecture.

Kevinhellomove avatar Nov 15 '24 09:11 Kevinhellomove

The peer dependencies currently don't refer to any specific version but actually just to "*". So it shouldn't cause any problems.

Can you maybe hint me on how to reproduce it?

RonRadtke avatar Nov 16 '24 12:11 RonRadtke

after updating my app to react native 0.76.2 my android build doesnt build any more. i get this error:

` Task :react-native-blob-util:generateCodegenArtifactsFromSchema FAILED

/Users/tristanveskilt/WebstormProjects/cara-health-app/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJniCpp.js:478 .map(({name: propertyName, typeAnnotation}) => { ^

TypeError: Cannot read properties of undefined (reading 'map') at /Users/tristanveskilt/WebstormProjects/cara-health-app/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJniCpp.js:478:16 at Array.map () at generate (/Users/tristanveskilt/WebstormProjects/cara-health-app/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleJniCpp.js:455:8) at Object.generate (/Users/tristanveskilt/WebstormProjects/cara-health-app/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/RNCodegen.js:212:9) at generateSpecFromInMemorySchema (/Users/tristanveskilt/WebstormProjects/cara-health-app/node_modules/react-native/scripts/codegen/generate-specs-cli-executor.js:78:22) at Object.generateSpec [as execute] (/Users/tristanveskilt/WebstormProjects/cara-health-app/node_modules/react-native/scripts/codegen/generate-specs-cli-executor.js:115:3) at main (/Users/tristanveskilt/WebstormProjects/cara-health-app/node_modules/react-native/scripts/generate-specs-cli.js:51:12) at Object. (/Users/tristanveskilt/WebstormProjects/cara-health-app/node_modules/react-native/scripts/generate-specs-cli.js:61:1) `

any idea what could be wrong?

TVeskilt avatar Nov 18 '24 12:11 TVeskilt

Are you useing expor or anything other special? Which version of the library?

RonRadtke avatar Nov 18 '24 13:11 RonRadtke

nope, no expo, vanilla react-native. Library version "react-native-blob-util": "^0.19.11",

Update: Got it working, issue on my side

TVeskilt avatar Nov 18 '24 13:11 TVeskilt

This library works fine on the latest versions of react-native and Expo

paksa92 avatar Nov 20 '24 17:11 paksa92

The other block is the @config-plugins/react-native-blob-util if it was managed by this project and not tied to expo@51 it will help, but please make sure you still allow expo 51 so people are not forced to update if they don't need to. You can use "expo": "51 || 52" much like I did on https://github.com/revtel/react-native-nfc-manager/pull/758/files

trajano avatar Nov 22 '24 00:11 trajano

@trajano jsut so I understand it correctly. The problems technically ist in https://www.npmjs.com/package/@config-plugins/react-native-blob-util ? ANd, probably, the expo version etc there?

So what you're asking me to do, is, adding the peer depedencies for expo so we don't need the plugin right?

RonRadtke avatar Nov 22 '24 07:11 RonRadtke

@RonRadtke for my issue specifically yes. Though we can lock to the current version if we need to remain in Expo 51 since it works so far. However, if you update to support Expo 52 (which includes the config plugin).

Looking at what https://github.com/expo/config-plugins/blob/main/packages/react-native-blob-util/src/withReactNativeBlobUtil.ts it seems to add some permissions specific to Android. Then again looking at your README. I don't particularly see it matching

e.g. "android:name": "android.intent.action.DOWNLOAD_COMPLETE",

     $: {
    "android:name": "com.facebook.react.modules.blob.BlobProvider",
    "android:authorities": "@string/blob_provider_authority",
    "android:exported": "false",
  },

trajano avatar Nov 22 '24 10:11 trajano

Honesrtly my understanding of all that expo stuff is not good enough to judge what is going on int the config plugin. The DOWNLOAD_COMPLETE ident is used, when using the downloadmanager. If you ahve a working version that covers expo 52 and 51 I am willing to merge it, as long as it doesn't iimpact non expo users

RonRadtke avatar Nov 22 '24 21:11 RonRadtke

I'm not sure if I can make one yet the main reason for using this library is react-native-pdf which doesn't seem to work on Expo 52 at all.

trajano avatar Nov 23 '24 06:11 trajano

react-native-pdf does work with Expo 52 unless you have the new architecture turned on. You need to use a patch if you want to use react-native-pdf with the new architecture.

griffinshuth avatar Nov 27 '24 16:11 griffinshuth

@griffinshuth yep I enabled new arch to see what happens. Also new arch is default with new Expo 52 template

trajano avatar Nov 27 '24 20:11 trajano

@trajano this lib should work fine with the new arch.

RonRadtke avatar Nov 27 '24 20:11 RonRadtke

But regardless, if anyone can provide a PR and test it accordingly I would be very grateful. Then I don'T have to dig trough all the expo stuff.

RonRadtke avatar Nov 27 '24 20:11 RonRadtke

@RonRadtke I just need react-native-pdf to work with new arch as well. The reason for this lib for me was primarily for that module as Expo provides similar APIs already.

trajano avatar Nov 27 '24 21:11 trajano

react-native-pdf does work with Expo 52 unless you have the new architecture turned on. You need to use a patch if you want to use react-native-pdf with the new architecture.

Hi @griffinshuth, do you have some information about this patch ? thanks

acuD1 avatar Jan 01 '25 13:01 acuD1