Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always have to run plugin tests twice on iOS - Failed to load Info.plist from bundle at path #3957

Closed
NickIliev opened this issue Oct 1, 2018 · 6 comments
Assignees
Milestone

Comments

@NickIliev
Copy link
Contributor

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

> nativescript-bw-crypto@1.0.0 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


> nativescript-bw-crypto@1.0.0 tsc /Users/kyle/Projects/bitwarden/mobile-ns/plugins/bw-crypto/src
> tsc


> nativescript-bw-crypto@1.0.0 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

@NickIliev
Copy link
Contributor Author

From @dtopuzov on September 30, 2018 18:39

Hi @kspearrin,

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

@NickIliev
Copy link
Contributor Author

From @kspearrin on October 1, 2018 1:46

@dtopuzov Yes, I am using xcode 10.0

@ricmello
Copy link

ricmello commented Oct 1, 2018

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

@kspearrin
Copy link

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

@rosen-vladimirov
Copy link
Contributor

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.

@rosen-vladimirov
Copy link
Contributor

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

npm install -g nativescript@next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants