Nativescript-cli: Always have to run plugin tests twice on iOS - Failed to load Info.plist from bundle at path

Created on 1 Oct 2018  路  6Comments  路  Source: NativeScript/nativescript-cli

_From @kspearrin on September 28, 2018 19:19_

Tell us about the problem

I have a fairly basic plugin that was generated using the seed template. I have written some tests and can run them successfully on iOS and Android through the included demo app.

However, on iOS I always have to run the test twice for it to work. The first time it always errors with:

npm run ios:test

...

Unable to apply changes on device: B86F8CBA-19A9-4C80-9CFB-37DCDBEBBA18. Error is: Command xcrun with arguments simctl install B86F8CBA-19A9-4C80-9CFB-37DCDBEBBA18 /Users/kyle/Projects/bitwarden/mobile-ns/plugins/bw-crypto/demo/platforms/ios/build/emulator/demo.app failed with exit code 1. Error output:
 An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Failed to load Info.plist from bundle at path /Users/kyle/Library/Developer/CoreSimulator/Devices/B86F8CBA-19A9-4C80-9CFB-37DCDBEBBA18/data/Library/Caches/com.apple.mobile.installd.staging/temp.mTKlNf/extracted/Payload/demo.app
Failed to load Info.plist from bundle at path /Users/kyle/Library/Developer/CoreSimulator/Devices/B86F8CBA-19A9-4C80-9CFB-37DCDBEBBA18/data/Library/Caches/com.apple.mobile.installd.staging/temp.mTKlNf/extracted/Payload/demo.app
Underlying error (domain=MIInstallerErrorDomain, code=35):
    Failed to load Info.plist from bundle at path /Users/kyle/Library/Developer/CoreSimulator/Devices/B86F8CBA-19A9-4C80-9CFB-37DCDBEBBA18/data/Library/Caches/com.apple.mobile.installd.staging/temp.mTKlNf/extracted/Payload/demo.app

I can simply run the same test script again (npm run ios:test), it it works. This happens every single time no matter what I have tried.

Basically, the iOS test command only works every other time it is ran.

This is through the simulator. I have also tried clearing the ./demo/platforms directory, but that didn't seem to change anything.

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.2.2
  • Cross-platform modules: 4
  • Runtime(s): 4.2

Please tell us how to recreate the issue in as much detail as possible.

You can download my plugin code here:
https://github.com/bitwarden/mobile/tree/ns2/plugins/bw-crypto

Then run

npm i
npm run ios:test

Observe failure. Then run

npm run ios:test

Observe success.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

Full output from terminal:

$ npm run test:ios

> [email protected] test:ios /Users/kyle/Projects/bitwarden/mobile-ns/plugins/bw-crypto/src
> npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch --emulator


> [email protected] tsc /Users/kyle/Projects/bitwarden/mobile-ns/plugins/bw-crypto/src
> tsc


> [email protected] tslint /Users/kyle/Projects/bitwarden/mobile-ns/plugins/bw-crypto/src
> cd .. && tslint "**/*.ts" --config tslint.json --exclude '**/node_modules/**' --exclude 'demo/**/*' --exclude '**/*.d.ts'

Executing before-prepare hook from /Users/kyle/Projects/bitwarden/mobile-ns/plugins/bw-crypto/demo/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.9.2
Preparing project...
Project successfully prepared (ios)
Executing after-prepare hook from /Users/kyle/Projects/bitwarden/mobile-ns/plugins/bw-crypto/demo/hooks/after-prepare/nativescript-unit-test-runner.js
Building project...
Xcode build...
warning: /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Y0LVQ9G7OBT/UIKit-1V5UHAPTOD24G.pcm: No such file or directory
note: while processing /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Y0LVQ9G7OBT/UIKit-1V5UHAPTOD24G.pcm
note: Linking a static library that was built with -gmodules, but the module cache was not found.  Redistributable static libraries should never be built with module debugging enabled.  The debug experience will be degraded due to incomplete debug information.
warning: /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Y0LVQ9G7OBT/Darwin-38I6DLZ5IH61J.pcm: No such file or directory
note: while processing /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Y0LVQ9G7OBT/Darwin-38I6DLZ5IH61J.pcm
warning: /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Y0LVQ9G7OBT/Foundation-3DFYNEBRQSXST.pcm: No such file or directory
note: while processing /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Y0LVQ9G7OBT/Foundation-3DFYNEBRQSXST.pcm
warning: /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Y0LVQ9G7OBT/Dispatch-2LX9MWM6UEPQW.pcmwarning: : No such file or directory/Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/9G23JDZCI6P8/UIKit-1V5UHAPTOD24G.pcm: No such file or directory

note: note: while processing while processing /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Y0LVQ9G7OBT/Dispatch-2LX9MWM6UEPQW.pcm
/Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/9G23JDZCI6P8/UIKit-1V5UHAPTOD24G.pcm
note: Linking a static library that was built with -gmodules, but the module cache was not found.  Redistributable static libraries should never be built with module debugging enabled.  The debug experience will be degraded due to incomplete debug information.
warning: /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Y0LVQ9G7OBT/ObjectiveC-1R06XOY9T4FIM.pcm: No such file or directory
warning: note: /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/9G23JDZCI6P8/Darwin-38I6DLZ5IH61J.pcmwhile processing : /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Y0LVQ9G7OBT/ObjectiveC-1R06XOY9T4FIM.pcmNo such file or directory

note: while processing /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/9G23JDZCI6P8/Darwin-38I6DLZ5IH61J.pcm
warning: /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/9G23JDZCI6P8/Foundation-3DFYNEBRQSXST.pcm: No such file or directory
note: while processing /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/9G23JDZCI6P8/Foundation-3DFYNEBRQSXST.pcm
warning: /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/9G23JDZCI6P8/Dispatch-2LX9MWM6UEPQW.pcm: No such file or directory
note: while processing /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/9G23JDZCI6P8/Dispatch-2LX9MWM6UEPQW.pcm
warning: /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/9G23JDZCI6P8/ObjectiveC-1R06XOY9T4FIM.pcm: No such file or directory
note: while processing /Users/nsbuilduser/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/9G23JDZCI6P8/ObjectiveC-1R06XOY9T4FIM.pcm
note: Using new build systemnote: Planning buildnote: Constructing build description
Project successfully built.
Searching for devices...
28 09 2018 15:10:24.147:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
28 09 2018 15:10:24.152:INFO [launcher]: Launching browser ios with unlimited concurrency
28 09 2018 15:10:24.158:INFO [launcher]: Starting browser NativeScript Unit Test Runner
Executing before-prepare hook from /Users/kyle/Projects/bitwarden/mobile-ns/plugins/bw-crypto/demo/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.9.2
Preparing project...
Project successfully prepared (ios)
Executing after-prepare hook from /Users/kyle/Projects/bitwarden/mobile-ns/plugins/bw-crypto/demo/hooks/after-prepare/nativescript-unit-test-runner.js
Skipping prepare.
Installing...
Unable to apply changes on device: B86F8CBA-19A9-4C80-9CFB-37DCDBEBBA18. Error is: Command xcrun with arguments simctl install B86F8CBA-19A9-4C80-9CFB-37DCDBEBBA18 /Users/kyle/Projects/bitwarden/mobile-ns/plugins/bw-crypto/demo/platforms/ios/build/emulator/demo.app failed with exit code 1. Error output:
 An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Failed to load Info.plist from bundle at path /Users/kyle/Library/Developer/CoreSimulator/Devices/B86F8CBA-19A9-4C80-9CFB-37DCDBEBBA18/data/Library/Caches/com.apple.mobile.installd.staging/temp.mTKlNf/extracted/Payload/demo.app
Failed to load Info.plist from bundle at path /Users/kyle/Library/Developer/CoreSimulator/Devices/B86F8CBA-19A9-4C80-9CFB-37DCDBEBBA18/data/Library/Caches/com.apple.mobile.installd.staging/temp.mTKlNf/extracted/Payload/demo.app
Underlying error (domain=MIInstallerErrorDomain, code=35):
    Failed to load Info.plist from bundle at path /Users/kyle/Library/Developer/CoreSimulator/Devices/B86F8CBA-19A9-4C80-9CFB-37DCDBEBBA18/data/Library/Caches/com.apple.mobile.installd.staging/temp.mTKlNf/extracted/Payload/demo.app
.

_Copied from original issue: NativeScript/NativeScript#6323_

bug ios

Most helpful comment

Hey guys, the fix is available in CLI's next version, you can install it by executing:

npm install -g nativescript@next

All 6 comments

_From @dtopuzov on September 30, 2018 18:39_

Hi @kspearrin,

I've noticed similar behavior after upgrade to Xcode10. What is you Xcode version?

_From @kspearrin on October 1, 2018 1:46_

@dtopuzov Yes, I am using xcode 10.0

This happened with me after upgrade to xcode 10.0, but I solved it by erasing all content and settings of simulator.

@ricardo-mello I tried "Erase all content and settings" on this simulator (iPhone 6), yet the same problem still seems to be occurring.

Hey @kspearrin ,
Thanks for reporting this issue. We have reproduced it on our side, but unfortunately it looks like this is a problem in the xcrun install command. We have managed to reproduce the issue (sporadically) without using NativeScript CLI, just running:

xcrun simctl install <simulator identifier> <path to .app> 

The only workaround that we can implement in the moment is to retry the operation in case it fails. It is not a great solution, but it will fix the current issue. We'll try this approach and write back here once we have at least this fix applied.

Hey guys, the fix is available in CLI's next version, you can install it by executing:

npm install -g nativescript@next
Was this page helpful?
0 / 5 - 0 ratings