google / google/EarlGrey

[EarlGrey1] "Failed to load the test bundle" error in Xcode 14

Open
#1,844 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
5.7k
Forks
737
Avg merge
1d 20h
Merged PRs (30d)
5

Description

Running EarlGrey1 tests against the iOS 13 Simulator is possible in Xcode 13 and older versions but not in Xcode 14.0, Xcode 14.1 and possibly newer versions of Xcode 14.

Running EarlGrey1 tests in Xcode 14.0 and Xcode 14.1 results in the following error:

```
Assertions: System: Failed to load the test bundle. If you believe this error represents a bug, please attach the result bundle at /Users/adilhussain/Library/Developer/Xcode/DerivedData/EarlGreyExperiment-dxfuddrtpdijnhhhmgkzxzvtmhad/Logs/Test/Test-EarlGreyExperiment-2022.11.01_08-37-29-+0000.xcresult. (Underlying Error: The bundle “EarlGreyExperimentTests” couldn’t be loaded because it is damaged or missing necessary resources. The bundle is damaged or missing necessary resources. Try reinstalling the bundle. dlopen_preflight(/Users/adilhussain/Library/Developer/CoreSimulator/Devices/67BA52C5-FF97-4A73-ABEB-4AE4718BDD82/data/Containers/Bundle/Application/7A233CF7-ECC2-42C9-9633-3AC76296F0C6/EarlGreyExperiment.app/PlugIns/EarlGreyExperimentTests.xctest/EarlGreyExperimentTests): Library not loaded: @rpath/XCTest.framework/XCTest
Referenced from: /Users/adilhussain/Library/Developer/CoreSimulator/Devices/67BA52C5-FF97-4A73-ABEB-4AE4718BDD82/data/Containers/Bundle/Application/7A233CF7-ECC2-42C9-9633-3AC76296F0C6/EarlGreyExperiment.app/PlugIns/EarlGreyExperimentTests.xctest/Frameworks/EarlGrey.framework/EarlGrey
Reason: Incompatible library version: EarlGrey requires version 1.0.0 or later, but XCTest provides version 0.0.0)
```

You can see this error firsthand in [this](https://github.com/adil-hussain-84/EarlGreyExperiment) super simple Xcode workspace. The tests in this workspace run fine in Xcode 13 but not in Xcode 14.

Note: I am aware that EarlGrey1 is deprecated. I am sharing this as a point of information for anyone like me who still has EarlGrey1 tests that they have not yet migrated away from EarlGrey1.

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported failure using the EarlGreyExperiment workspace, EarlGreyExperimentTests.xctest, an iOS 13 Simulator, and Xcode 14.0 or 14.1; compare it with Xcode 13. The issue provides no project file, test entry point, requested change, or acceptance condition, so the intended definition of done is not specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios
Domain
mobile-dev, testing
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.