pendo-io / pendo-mobile-sdk

Pendo captures product usage data, gathers user feedback, and lets you communicate in-app to onboard, educate, and guide users to value
https://www.pendo.io
Other
57 stars 2 forks source link

React Native App with React Navigation in TypeScript - Building in Microsoft AppCenter is failing for iOS #18

Closed shariq-muhammad closed 1 year ago

shariq-muhammad commented 1 year ago

We use Visual Studio AppCenter to build code from our repo and in the cloud. It automatically run unit tests and releases the app to testers and stores (Android, iOS).

When building the React Native app in AppCenter, it failed for iOS with many errors for Pendo.arm64.xar. I opened the issue initially at pendo-io/RN-demo-app-React-Navigation repo, but was advised to open it here.

Most of the errors are similar to the below about the address of an intrinsic:

Clang: cd /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/temptc3472sy ['/Applications/Xcode_13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang', '-cc1', '-cc1', '-triple', 'arm64-apple-ios9.0.0', '-emit-obj', '--mrelax-relocations', '-disable-llvm-passes', '-faligned-alloc-unavailable', '-target-sdk-version=15.4', '-fvisibility-inlines-hidden-static-local-var', '-target-abi', 'darwinpcs', '-Os', '-x', 'ir', '002', '-o', '002.o'] -= Output =- Cannot take the address of an intrinsic! %18 = tail call i8 bitcast (i8 (i8, i8, ...) @objc_msgSend to i8 (i8, i8))(i8 %16, i8 %17) #12 [ "clang.arc.attachedcall"(i8 (i8) @llvm.objc.retainAutoreleasedReturnValue) ], !dbg !53, !clang.arc.no_objc_arc_exceptions !41 Cannot take the address of an intrinsic! ... ... ... ... ... ... ...

%37 = call %7 bitcast (i8 (i8, i8, ...) @objc_msgSend to %7 (i8, i8))(i8 %35, i8 %36) #7 [ "clang.arc.attachedcall"(i8 (i8) @llvm.objc.retainAutoreleasedReturnValue) ], !dbg !603 fatal error: error in backend: Broken module found, compilation aborted! Exited with 70

Failed to compile bundle: /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/Pendonzdrrlvp/Pendo.arm64.xar Stderr:

/Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/ipatool:372:in run' /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/ipatool:2886:inblock in CompileOrStripBitcodeInBundle' /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/ipatool:2825:in each' /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/ipatool:2825:inCompileOrStripBitcodeInBundle' /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/ipatool:3112:in block in ProcessIPA' /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/ipatool:3073:ineach' /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/ipatool:3073:in ProcessIPA' /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/ipatool:4035:in

'} EXPORT FAILED

[error]Error: /usr/bin/xcodebuild failed with return code: 70

MikePendo commented 1 year ago

@shariq-muhammad I forgot to ask what Pendo SDK version do u use, could u please try to update to latest one. (if you are using and old Pendo version that might be the case as fat frameworks will have have issues) As far as I understand the issue happens only in AppCenter portal. We have couple of clients that are using AppCenter but nobody reported an issue yet. If we dont find a resolution on our side I would suggest to open and issue in Appcenter and see what can they suggest

MikePendo commented 1 year ago

@shariq-muhammad Any update about your issue?

shariq-muhammad commented 1 year ago

@MikePendo We are using rn-pendo-sdk version ^2.18.0. The issue still persist at our end causing release delays, please let us know if you have a resolution.

MikePendo commented 1 year ago

@shariq-muhammad As it works fine locally on both ends, its very hard to say why its not working in the app center. (without full logs ) They have a similar issue: here I would suggest to ask their support: AppCenter

shariq-muhammad commented 1 year ago

@MikePendo we are using Xcode version 13.2.1, does Pendo have specific Xcode version requirements?

MikePendo commented 1 year ago

For react-native, no. U can try t use the latest Xcode 13.4 and see how that works. But ,again, its hard to say without seeing more log output and understanding what is actually running (its seems some sort of compiler issue ) If u create and archive and try too upload it to iTunes connect will that work (u dont have t release the app, just to see if Apple process will work for u)

shariq-muhammad commented 1 year ago

@MikePendo Does having 'Enable BitCode' setting to 'yes' matters for Pendo for React Native? I saw it here, not sure if it is applicable in our case or not.

MikePendo commented 1 year ago

We release the SDK with Bitcode enabled. Insert is a v1 and is no longer supported. You can try to set it BUT again I need more detailed logs to help, and (in your case) I would try to see if the release process of Apple work for u i.e archive and upload, if it does it means that u r doing(or AppCenter) something additional in the release process if it doesnt work we will need to create sample RN project on our end and try to see if we have the same issue

MikePendo commented 1 year ago

So I have have created new app added Pendo and distributed it locally as .ipa (compiling with bitcode) That worked for me. Can u do it locally on your Mac?

shariq-muhammad commented 1 year ago

@MikePendo Let me try that. In the meantime, this is what I found in the logs for the error:

2022-10-03T22:48:28.0169280Z [command]/usr/bin/xcodebuild -exportArchive -archivePath /Users/runner/work/1/output/build/archive/dev.xcarchive -exportPath /Users/runner/work/1/output/build/export/_XcodeTaskExport_dev -exportOptionsPlist _XcodeTaskExportOptions.plist 2022-10-03T22:48:29.1487230Z 2022-10-03 22:48:29.148 xcodebuild[59556:155877] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/dev_2022-10-03_22-48-29.147.xcdistributionlogs". 2022-10-03T22:50:47.3521210Z error: exportArchive: ipatool failed with an exception: #<CmdSpec::NonZeroExitException: $ /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/python3 /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/bitcode-build-tool -v -t /Applications/Xcode_13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin --sdk /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk -o /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/ipatool20221003-59580-d7gjg0/thinned-out/arm64/Payload/app/Frameworks/Pendo.framework/Pendo --generate-dsym /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/ipatool20221003-59580-d7gjg0/thinned-out/arm64/Payload/app/Frameworks/Pendo.framework/Pendo.dSYM --strip-swift-symbols /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/ipatool20221003-59580-d7gjg0/thinned-in/arm64/Payload/app/Frameworks/Pendo.framework/Pendo 2022-10-03T22:50:47.3523860Z Status: pid 63169 exit 1

MikePendo commented 1 year ago

@shariq-muhammad Lets try to disable bitcode (and see if that helps) as suggested: here Dont really fond of this hacks

MikePendo commented 1 year ago

@shariq-muhammad did u manage to try?

shariq-muhammad commented 1 year ago

@MikePendo Yes, after disabling bitcode it did build at App Center without the above mentioned errors.

MikePendo commented 1 year ago

In general I dont like those solution, coz those solution comes from some old threads to solve some issues on specific versions of Xcode. The bitcode enabled has his purpose. I would suggest to upgrade to the latest version of Xcode and see if that works for u (if u have the time). @shariq-muhammad I am closing the issue