MinaSamir11 / react-native-in-app-review

The Google Play In-App Review API, App store rating API lets you prompt users to submit Play Store or App store ratings and reviews without the inconvenience of leaving your app or game.
MIT License
647 stars 57 forks source link

getting error on ios build time #91

Closed shivam11gupta closed 2 years ago

shivam11gupta commented 2 years ago

/Users/jenkins_slave/Library/Developer/Xcode/DerivedData/Arbella_Mobile-blqxbvfriaheghbgxrjolhtcocdy/Build/Intermediates.noindex/ArchiveIntermediates/Arbella_Mobile/IntermediateBuildFilesPath/Arbella_Mobile.build/Release-iphoneos/Arbella_Mobile.build/Objects-normal/arm64/Binary/Arbella_Mobile ld: warning: Could not find or use auto-linked library 'swift_Concurrency' ld: warning: Could not find or use auto-linked library 'swiftFileProvider' ld: warning: Could not find or use auto-linked library 'swiftDataDetection' Undefined symbols for architecture arm64: "swift_FORCELOAD$_swiftDataDetection", referenced from: swift_FORCELOAD$swiftDataDetection$_react_native_in_app_review in libreact-native-in-app-review.a(RNInAppReviewIOS-e1790b5a904d9f60d9459fdc5fb17c8d.o) (maybe you meant: swift_FORCELOAD$swiftDataDetection$_react_native_in_app_review) "swift_FORCELOAD$_swiftFileProvider", referenced from: swift_FORCELOAD$swiftFileProvider$_react_native_in_app_review in libreact-native-in-app-review.a(RNInAppReviewIOS-e1790b5a904d9f60d9459fdc5fb17c8d.o) (maybe you meant: swift_FORCELOAD$swiftFileProvider$_react_native_in_app_review) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

shivam11gupta commented 2 years ago

My react native version is 0.63.2

MinaSamir11 commented 2 years ago

is your device M1 ?

MinaSamir11 commented 2 years ago

try to add this lines in your podfile:

post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" config.build_settings["EXCLUDED_ARCHS"] = "arm64” end end end

shivam11gupta commented 2 years ago

no, still not fixed, error was coming during jenkins build,

after your solution , new error is coming

1 error generated. fatal error: module map file '/Users/jenkins_slave/Library/Developer/Xcode/DerivedData/Arbella_Mobile-blqxbvfriaheghbgxrjolhtcocdy/Build/Intermediates.noindex/ArchiveIntermediates/Arbella_Mobile/BuildProductsPath/Release-iphoneos/react-native-in-app-review/react_native_in_app_review.modulemap' not found

MinaSamir11 commented 2 years ago

make sure it build successfully on your machine or not before run on another cloud machine.

try to run your project . xcworkspace in your machine with xcode. clean build and run npx pod-install.

or make sure file that jenkins run it to make a build ios, it’s extension is . xcworkspace

MinaSamir11 commented 2 years ago

no, still not fixed, error was coming during jenkins build,

after your solution , new error is coming

1 error generated. fatal error: module map file '/Users/jenkins_slave/Library/Developer/Xcode/DerivedData/Arbella_Mobile-blqxbvfriaheghbgxrjolhtcocdy/Build/Intermediates.noindex/ArchiveIntermediates/Arbella_Mobile/BuildProductsPath/Release-iphoneos/react-native-in-app-review/react_native_in_app_review.modulemap' not found

try to edit those lines to be empty string, strongly this sol. solve your second issue ..

config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "" config.build_settings["EXCLUDED_ARCHS"] = "”

liqiankl commented 2 years ago

Hey @MinaSamir11 I'm facing a similar issue. Project Details "react-native-in-app-review": "^3.2.3", "react-native": "0.63.3", Device Details Xcode Version 13.2.1 (Intel)

It runs completely fine on the simulator only when I try to release a build to test flight I am getting this error.

module map file '/Users/Abc/Library/Developer/Xcode/DerivedData/Project-dmcgxnkjieidszfshxleawrnjeog/Build/Intermediates.noindex/ArchiveIntermediates/Project/BuildProductsPath/Release-iphoneos/react-native-in-app-review/react_native_in_app_review.modulemap' not found

Screenshot 2022-03-10 at 3 32 35 PM

@shivam11gupta how did you fix your error?

MinaSamir11 commented 2 years ago

@liqiankl

1.) This library uses Swift code, so make sure that you have created the Objective-C bridging header file.

If not, open your project in Xcode and create an empty Swift file.

Xcode will ask if you wish to create the bridging header file, please choose yes.

For more information check Create Objective-C bridging header file.

2.) add this lines to your podfile

 use_flipper!()
  post_install do |installer|
    react_native_post_install(installer)
        installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] =  ""
        end
  end

OR

  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
      installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
          end
      end
  end

OR

if you are working with M1 chip add this Add arm64 under Architectures->Excluded Architectures