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

TypeError: Cannot read property 'identifier' of undefined #1565

Closed
redbluenat opened this issue Jul 30, 2019 · 19 comments · Fixed by #1694
Closed

TypeError: Cannot read property 'identifier' of undefined #1565

redbluenat opened this issue Jul 30, 2019 · 19 comments · Fixed by #1694

Comments

@redbluenat
Copy link

Description
I have a problem from this lib during running detox tests, simulators for react native works okay.

Screenshots
detox[17229] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
TypeError: Cannot read property 'identifier' of undefined
at AppleSimUtils.create (/.../node_modules/detox/src/devices/ios/AppleSimUtils.js: 100:100)

Environment

  • macOS version: 10.14.5
  • Xcode version: 10.3

Before Xcode update I didn't have this issue

@LeoNatan
Copy link
Contributor

If you run applesimutils --list, do you get a list of devices?

@redbluenat
Copy link
Author

redbluenat commented Jul 30, 2019

@LeoNatan yes, I have looooong list here is a part of it:

"isAvailable" : true, "state" : "Shutdown", "name" : "iPad Pro (10.5-inch)" }, { "availabilityError" : "", "os" : { "bundlePath" : "\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS 12.2.simruntime", "availabilityError" : "", "buildversion" : "16E226", "availability" : "(available)", "isAvailable" : true, "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-2", "version" : "12.2", "name" : "iOS 12.2" }, "availability" : "(available)", "deviceType" : { "name" : "iPad Pro (11-inch)", "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Pro (11-inch).simdevicetype", "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--11-inch-" }, "udid" : "6CA4A862-CCB6-48F5-94CE-C2CB9B226210", "isAvailable" : true, "state" : "Shutdown", "name" : "iPad Pro (11-inch)" }, { "availabilityError" : "", "os" : { "bundlePath" : "\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS 12.2.simruntime", "availabilityError" : "", "buildversion" : "16E226", "availability" : "(available)", "isAvailable" : true, "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-2", "version" : "12.2", "name" : "iOS 12.2" }, "availability" : "(available)", "deviceType" : { "name" : "iPad Pro (12.9-inch)", "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Pro (12.9-inch).simdevicetype", "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro" }, "udid" : "61DC4870-8B99-47DF-BA5D-564AFCE02C4F", "isAvailable" : true, "state" : "Shutdown", "name" : "iPad Pro (12.9-inch)" }, { "availabilityError" : "", "os" : { "bundlePath" : "\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS 12.2.simruntime", "availabilityError" : "", "buildversion" : "16E226", "availability" : "(available)", "isAvailable" : true, "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-2", "version" : "12.2", "name" : "iOS 12.2" }, "availability" : "(available)", "deviceType" : { "name" : "iPad Pro (12.9-inch) (2nd generation)", "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Pro (12.9-inch) (2nd generation).simdevicetype", "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-" }, "udid" : "C82A692B-A052-4F4C-A750-CAECE7529EC4", "isAvailable" : true, "state" : "Shutdown", "name" : "iPad Pro (12.9-inch) (2nd generation)" }, { "availabilityError" : "", "os" : { "bundlePath" : "\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS 12.2.simruntime", "availabilityError" : "", "buildversion" : "16E226", "availability" : "(available)", "isAvailable" : true, "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-2", "version" : "12.2", "name" : "iOS 12.2" }, "availability" : "(available)", "deviceType" : { "name" : "iPad Pro (12.9-inch) (3rd generation)", "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/iPad Pro (12.9-inch) (3rd generation).simdevicetype", "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---3rd-generation-" }, "udid" : "A4064FC2-2311-4733-A8DA-370AABA89461", "isAvailable" : true, "state" : "Shutdown", "name" : "iPad Pro (12.9-inch) (3rd generation)" }, { "availabilityError" : "", "os" : { "bundlePath" : "\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS 12.2.simruntime", "availabilityError" : "", "buildversion" : "16E226", "availability" : "(available)", "isAvailable" : true, "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-2", "version" : "12.2", "name" : "iOS 12.2" }, .... "availability" : "(available)", "deviceType" : { "name" : "Apple Watch Series 4 - 40mm", "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple Watch Series 4 - 40mm.simdevicetype", "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-40mm" }, "udid" : "23226F6A-43DF-4551-9098-9572E37D5B88", "isAvailable" : true, "state" : "Shutdown", "name" : "Apple Watch Series 4 - 40mm" }, { "availabilityError" : "", "os" : { "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/Runtimes\/watchOS.simruntime", "availabilityError" : "", "buildversion" : "16U567", "availability" : "(available)", "isAvailable" : true, "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-5-3", "version" : "5.3", "name" : "watchOS 5.3" }, "availability" : "(available)", "deviceType" : { "name" : "Apple Watch Series 4 - 44mm", "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/WatchOS.platform\/Developer\/Library\/CoreSimulator\/Profiles\/DeviceTypes\/Apple Watch Series 4 - 44mm.simdevicetype", "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-44mm" }, "udid" : "69EA4193-6A4D-4465-94EF-0D8C149FBDFF", "isAvailable" : true, "state" : "Shutdown", "name" : "Apple Watch Series 4 - 44mm" } ]

@LeoNatan
Copy link
Contributor

OK, so this is a Detox issue. Moving.

@LeoNatan LeoNatan transferred this issue from wix/AppleSimulatorUtils Jul 30, 2019
@LeoNatan
Copy link
Contributor

@redbluenat What version of applesimutils are you using?

@redbluenat
Copy link
Author

@LeoNatan applesimutils version 0.7.0

@LeoNatan
Copy link
Contributor

Very odd. I don't see a change in the output format from simctl, so applesimutils is exporting correctly.

@LeoNatan
Copy link
Contributor

Can you post your Detox config from package.json?

@redbluenat
Copy link
Author

"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/app.app",
"build": "xcodebuild -workspace ios/app.xcworkspace -scheme app -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone Xs"
},

@KaushanF94
Copy link

same issue

@LeoNatan
Copy link
Contributor

@noomorph Any insights here? Thanks

@noomorph
Copy link
Collaborator

Of course, the insight is that detox.init has not been called. Currently, by.id functions are platorm-specific, and initiated inside detox.init. If it is important for you to have a very early access to them, post a feature request and we'll see what we can do.

@LeoNatan
Copy link
Contributor

@noomorph Thanks! Could it also be that the init() somehow failed and that is causing this? Do you know what detox[13114] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR] is?

@noomorph
Copy link
Collaborator

noomorph commented Aug 21, 2019

Exactly, that's it. Init has failed.

@redbluenat
Copy link
Author

I resolved this issue by updating Detox and

gem install xcode-install
xcversion simulators --install='iOS 12.4'

and add to configuration

 "name": "iPhone X, iOS 12.4"

@WilGatlin
Copy link

WilGatlin commented Sep 3, 2019

I am still having this issue but only with threading. Particularly we are using --workers=3, though the # of workers, as long as its over 1, doesnt matter and will throw the error.

This is using jest and latest v of detox.

@WilGatlin
Copy link

Seems to be linked to this issue? #1395

@WilGatlin
Copy link

Resolved by cleaning out all previous xcode and applesimutils. Reinstalling both with latest.

@stale
Copy link

stale bot commented Oct 4, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this reporsitory, read this discussion.

@stale stale bot added the 🏚 stale label Oct 4, 2019
@noomorph noomorph self-assigned this Oct 7, 2019
@stale stale bot removed the 🏚 stale label Oct 7, 2019
@LeoNatan
Copy link
Contributor

LeoNatan commented Oct 7, 2019

We might have reproduced this issue locally.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants