bastengao / react-native-usb-serialport-for-android

MIT License
13 stars 28 forks source link

Exclude this on ios platform #8

Open lakpriya1s opened 11 months ago

lakpriya1s commented 11 months ago

I have a React Native Expo app that uses this package. It works perfectly on Android devices. However, when I attempt to run the same code on the iOS platform, I encounter the following error:

Error: The package 'react-native-usb-serialport-for-android' doesn't seem to be linked. Make sure: 

- You have run 'pod install'
- You rebuilt the app after installing the package
- You are not using Expo managed workflow

I tried below solutions but they are not working as expected.

In package.json

"expo": {
    "autolinking": {
      "ios": {
        "exclude": [
          "react-native-usb-serialport-for-android"
        ]
      }
    }
  }

In react-native.config.js

module.exports = {
   dependencies: {
      'react-native-usb-serialport-for-android': { platforms: { ios: null } } 
  } 
}

Suggest me a workaround to exclude this lib from ios platform while using in android!