newrelic / newrelic-maui-plugin

New Relic Mobile instrumentation for MAUI
Apache License 2.0
9 stars 5 forks source link

.Net MAUI on iOS fails to compile with New Relic plugin #50

Open robin-schroeder-merc opened 1 month ago

robin-schroeder-merc commented 1 month ago

Description

When building in VSCode for iOS, we get the following message:

PackageInspectionFailed: Failed to load Info.plist from bundle at path /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.sENDap/extracted/xxxxx.app/Frameworks/NewRelic.framework; Extra info about "/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.sENDap/extracted/xxxxx.app/Frameworks/NewRelic.framework/Info.plist": dev=16777219 ino=11385879 mode=0100644 nlink=1 uid=33 gid=33 rdev=0 size=787 atime=1728418403.000000 mtime=1728418402.000000 ctime=1644146.054893 birthtime=1644145.392530 blksize=4096 blocks=8 flags=0x0 firstBytes={length = 4, bytes = 0x62706c69} ACL= extendedAttributes=

error MT1006: Could not install the application '/Users/xxxx/Documents/Code/xxxx-Mobile/xxxx/xxxx/bin/Debug/net8.0-ios/ios-arm64/xxxx.app' on the device 'f4931ff21xxxxxxxxxxx0a82ace51': Package Inspection Failed Error (error: 0xe8000051).

Describe the problem you're encountering.

Failed compilation

Steps to Reproduce

Add New Relic and solution fails to compile in VSCode on a Mac. Works fine on a PC with Android.

Expected Behavior

Successful compilation

Relevant Logs / Console output

see above

Your Environment

MacBook Pro VSCode 1.94.1 .Net MAUI extension v1.3.29 C# extension v2.50.25 XCode 15.4

Additional context

ndesai-newrelic commented 1 month ago

@robin-schroeder-merc which version of newrelic maui package are you using?

robin-schroeder-merc commented 1 month ago

With 1.1.2 it gives the error above. With 1.1.3 the app installs, but crashes immediately after it opens. I will be actively working on this today as it is blocking the team. I will update this post if I find anything new.

robin-schroeder-merc commented 1 month ago

Running with Rider (instead of VSCode) on MacBook Pro, XCode 15.4, solution has New Relic v1.1.3. The app installs and the crashes on open. Here is the error: Error running 'xxx' Failed to install application on device iPhone: error MT1006: Could not install the application '/ Users/ xxx/ Documents/ Code/xxx/xxx/xxx/ bin/ Debug/ net8.0-ios/ ios-arm64/xxxx. app' on the device 'iPhone': One or more errors occurred. (Failed to execute 'devicectl': 'devicectl -j / var/ folders/ 43/ d0xnxts965v2l2cxg3wb3fnh0000gn/ T/ tmpIfwLky. tmp device install app --device iPhone / Users/ xxx/ Documents/ Code/ xxx/ xxx/ xxx/ bin/ Debug/ net8.0-ios/ ios-arm64/ xxx. app' returned the exit code 1.) (Additional output: xcrun devicectl -j / var/ folders/ 43/ d0xnxts965v2l2cxg3wb3fnh0000gn/ T/ tmpIfwLky. tmp device install app --device iPhone / Users/ xxx/ Documents/ Code/ xxx/ xxx/ xxx/ bin/ Debug/ net8.0-ios/ ios-arm64/ xxx. app) (Additional output: 09:59:10 Acquired tunnel connection to device.) (Additional output: 09:59:10 Enabling developer disk image services.) (Additional output: 09:59:10 Acquired usage assertion.) (Additional output: ERROR: Failed to install the app on the device. (com. apple. dt. CoreDeviceError error 3002 (0xBBA))) (Additional output: NSURL = file:/// Users/ xxx/ Documents/ Code/ xxx/ xxx/ xxx/ bin/ Debug/ net8.0-ios/ ios-arm64/ xxx. app/) (Additional output: ----------------------------------------) (Additional output: Unable to Install “xxx” (IXUserPresentableErrorDomain error 1 (0x01))) (Additional output: NSLocalizedRecoverySuggestion = Failed to load Info. plist from bundle at path / var/ installd/ Library/ Caches/ com. apple. mobile. installd. staging/ temp. Pe4Tkg/ extracted/ xxx. app/ Frameworks/ NewRelic. framework; Extra info about "/ var/ installd/ Library/ Caches/ com. apple. mobile. installd. staging/ temp. Pe4Tkg/ extracted/ xxx. app/ Frameworks/ NewRelic. framework/ Info. plist": dev=16777220 ino=2322569 mode=0100644 nlink=1 uid=33 gid=33 rdev=0 size=787 atime=1728485947.000000 mtime=1728485947.000000 ctime=1728485954.414160 birthtime=1728485947.000000 blksize=4096 blocks=8 flags=0x0 firstBytes={length = 4, bytes = 0x62706c69} ACL= extendedAttributes= ) (Additional output: NSLocalizedFailureReason = Please try again later.) (Additional output: ----------------------------------------) (Additional output: Failed to load Info. plist from bundle at path / var/ installd/ Library/ Caches/ com. apple. mobile. installd. staging/ temp. Pe4Tkg/ extracted/ xxx. app/ Frameworks/ NewRelic. framework; Extra info about "/ var/ installd/ Library/ Caches/ com. apple. mobile. installd. staging/ temp. Pe4Tkg/ extracted/ xxxx. app/ Frameworks/ NewRelic. framework/ Info. plist": dev=16777220 ino=2322569 mode=0100644 nlink=1 uid=33 gid=33 rdev=0 size=787 atime=1728485947.000000 mtime=1728485947.000000 ctime=1728485954.414160 birthtime=1728485947.000000 blksize=4096 blocks=8 flags=0x0 firstBytes={length = 4, bytes = 0x62706c69} ACL= extendedAttributes= (MIInstallerErrorDomain error 35 (0x23))) (Additional output: SourceFileLine = 64) (Additional output: FunctionName = -[MIBundle _validateWithError:]) (Additional output: LegacyErrorString = PackageInspectionFailed) (Additional output: 1%... 2%... 3%... 4%... 5%... 6%... 7%... 8%... 9%... 10%... 11%... 12%... 13%... 14%... 15%... 16%... 18%... 19%... 20%... 21%... 22%... 23%... 24%... 25%... 26%... 27%... 28%... 30%... 31%... 32%... 33%... 34%... 35%... 36%... 37%... 38%... 39%... 40%... 41%... 42%... 43%... 44%... 45%... 46%... 47%... 48%... 49%... 50%... 51%... 52%... 53%... 54%... 55%... 56%... 57%... 59%... 60%... 62%... 66%... 68%... ).

robin-schroeder-merc commented 1 month ago

We have our .Net SDK and workloads pinned at 8.0.402

ndesai-newrelic commented 1 month ago

@robin-schroeder-merc are you using actual device to test this?

ndesai-newrelic commented 1 month ago

@robin-schroeder-merc are you able to reproduce on sample app?

robin-schroeder-merc commented 1 month ago

Yes, I have two iphones, one on ios 18, another on ios 15, both have the same error. I cloned the main branch of your repo and ran it on my MacBook in Rider. I didn't change anything. I got the following error: Error running 'NewRelic. MAUI. Plugin' Info. plist not found

ndesai-newrelic commented 1 month ago

@robin-schroeder-merc i am unable to reproduce it from my side.

robin-schroeder-merc commented 1 month ago

What version of .Net SDK and what version of the MAUI workloads are you running?

ndesai-newrelic commented 1 month ago

dotnet version: 8.0.204

net8.0-android;net8.0-ios;net8.0-maccatalyst
robin-schroeder-merc commented 1 month ago

We have two .Net MAUI apps that we are trying to migrate from App Center to New Relic. We have pinned both to .Net SDK 8.0.402 and the workloads to 8.0.402. You can only pin the workloads in global.json at or after 8.0.400. (https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-workload-sets) When we run the iOS version of our apps without the New Relic plugin (v1.1.3), it all runs just fine. When we introduce the New Relic plugin, the app compiles, but crashes soon after it launches. The crash is not registering in the New Relic portal, but the other data (logs, etc) are being collected. I tried to roll back to .Net 8.0.204 (as you guys are running that version) but my MacBook has now already updated to Mac OS Sequoia and I cannot pin the workload properly. I guess our best bet now is to wait for you guys to update to 8.0.402 or later and see if you encounter the same problem? For now, I guess we need to backburner this work...

ndesai-newrelic commented 1 month ago

@robin-schroeder-merc I will check it from my side, but this info is really helpfull.

robin-schroeder-merc commented 1 month ago

I think much of this is really new to all of us as the .Net MAUI 'rules of engagement' continue to get refined. If I have time next week, and you haven't gotten to it yet, maybe I can do a PR to help fix this. Thanks for your quick responses. Today I learned that one of our internal libraries was causing a similar crash. It was pinned to 8.0.302 and when I pinned it to 8.0.402 (pinned workloads too) the crash disappeared. Also wanted to mention that I ran the apps with the iOS console and it was no help. It wasn't reporting any kind of fault or error before the crash. The ground is moving around underneath us, it seems. Thanks again for your quick responses.

robin-schroeder-merc commented 1 month ago

Perhaps I was being a little ambitious with the configurations, but when I remove the following interactionTracingEnabled argument, I do not experience a crash soon after startup (ios only). NewRelic.MAUI.Plugin.AgentStartConfiguration agentConfig = NewRelic.MAUI.Plugin.AgentStartConfiguration(interactionTracingEnabled: true);

changed to

NewRelic.MAUI.Plugin.AgentStartConfiguration agentConfig = NewRelic.MAUI.Plugin.AgentStartConfiguration();

Thanks!

ndesai-newrelic commented 1 month ago

@robin-schroeder-merc we disabled interactionTracing to avoid this kind of issues.

ndesai-newrelic commented 1 month ago

@robin-schroeder-merc can I close this one now?

sgreifeneder commented 4 weeks ago

@ndesai-newrelic I have the same issue with v1.1.4. App crashes right after opening it (TestFlight build), but works locally. I'm not configuring any AgentStartConfiguration

ndesai-newrelic commented 4 weeks ago

@sgreifeneder can you share your crash report?

sgreifeneder commented 4 weeks ago

@ndesai-newrelic ios_crash_report.zip

sgreifeneder commented 3 weeks ago

@ndesai-newrelic hi, any update here? could you already check the crash report?

robin-schroeder-merc commented 3 weeks ago

@robin-schroeder-merc can I close this one now?

Yes. We are not having any issues anymore. It sounds like @sgreifeneder might be having a different issue? Our issue was resolved by removing AgentStartConfiguration setting. Thank you.

ndesai-newrelic commented 3 weeks ago

@sgreifeneder We are unable to reproduce the issue, can you share sample app ?

sgreifeneder commented 2 weeks ago

@ndesai-newrelic did you try by actually signing the app and upload to TestFlight?

sgreifeneder commented 1 day ago

I've updated a few things in my GitHub action (Xcode 16.0->16.1, dotnet version 8.0.402->8.0.x, no version pinning to 8.0.402 for maui workload anymore and added strip replacement as per https://github.com/xamarin/xamarin-macios/issues/19157). Now it seems to be working ... maybe that info can help you finding the issue.