ios – Build input file cannot be found in React-native lib

So let me tell you what I am doing first.

I have a RN app/project which I am converting to npm library.

I build a dist folder where I build and copy my Android, ios and Js file

for iOS, I run this command

npm run "ios:lib": "rsync -r ./ios --exclude='.*' --exclude='xyzClientMobile' --exclude='xyzClientMobile.xcworkspace'--exclude='xyzClientMobile-tvOS' --exclude='xyzClientMobile-tvOSTests'  --exclude='xyzClientMobileTests' --exclude='Pods' --exclude='Podfile.lock'  ./dist && npm run ios:podspec",

Now all good until I try to build my app in IOS, where it gives folllowing error

Build input file cannot be found: ‘main.m’ (in target ‘xyz-mobile’ from project ‘Pods’)

I am not sure how to fix, but when I search for main.m reference in my project from which I was creating lib, I see its reference in multiple places inside .xcodeproj > project.pbxproj

some thing like this

13B08FB71A68208900A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = xyzClientMobile/main.m; sourceTree = "<group>"; };

Any idea how I can fix it?