Can't run UITest on iphone 4s simulator with xcode 9 - ios

Project can build properly on iphone 4s simulator but trying to run UITest on it gives me the error :
The bundle “MyappUITests” couldn’t be loaded because it doesn’t contain a version for the current architecture. Try installing a universal version of the bundle.
Can't seem to figure out the root cause for this, tests are running properly on every other simulator.
Any thoughts?

I have solved this problem setting "iOS Deployment Target" of the UITest target to iOS 9.0. It was created with 11.1 value by Xcode.

I experienced this error while trying to get a new M1 Macbook Pro to run XCUITests.
I had set Excluded Architectures (in the Build Settings) for Simulator SDK to be arm64 for both the main target and the XCUITests target. Removing this exclusion from the XCUITests target fixed this error.
Hope this helps some others who are having a nightmare like me with the new M1 Macbooks... wish I'd never upgraded.

Following up on the above answer by Charlie Seligman, I also had an issue running XCUITests. Was able to solve it by setting all options under "Build Active Architecture only" to "no", in XCode build settings. Details: https://github.com/appium/java-client/issues/1444#issuecomment-781078298

Related

Unity iOS build problem archive build success but simulator run failed

there is a problem that I haven't been able to solve since yesterday. I get an ios build from Unity and then run it with xcode. When I follow the path xcode -> product -> archive and get build, I can get it and publish it without any problems, but when I want to try it on the simulator, UnityFramework gives a lot of errors. How can I solve this problem?
Errors
Fixed.
"Did you change the SDK version in the Unity iOS player settings to Simulator SDK?"
I change the sdk "Device" to "Simulator" fixed.

Xcode 10 test failure when running on older iOS simulators - "Failed to load test bundle... no suitable image found"

I've installed Xcode 10 and upgraded my iOS application to Swift 4.2. When I run my tests (both UI and Unit) via Xcode, on an iPhone simulator running iOS 12, the tests successfully start. When I attempt to run the tests on a simulator running a prior iOS version (e.g. iOS 10.3.1), I get a "failure to load the test bundle". These tests were running successfully on Xcode 9.4. I can run my app on this older simulator without an issue.
The Xcode output is as follows ("Reading List" is the application name):
2018-09-16 15:11:36.667 ReadingList[11401:11478426] Failed to load test bundle from file:///Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/: Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/ReadingList_UnitTests): no suitable image found. Did find:
/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/ReadingList_UnitTests: mach-o, but not built for iOS simulator" UserInfo={NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/ReadingList_UnitTests, NSDebugDescription=dlopen_preflight(/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/ReadingList_UnitTests): no suitable image found. Did find:
/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest/ReadingList_UnitTests: mach-o, but not built for iOS simulator, NSBundlePath=/Users/andrewbennet/Library/Developer/Xcode/DerivedData/ReadingList-edsxqugqvkymbgfrbivbjmzebuya/Build/Products/Debug-iphonesimulator/ReadingList.app/PlugIns/ReadingList_UnitTests.xctest, NSLocalizedDescription=The bundle “ReadingList_UnitTests” couldn’t be loaded because it is damaged or missing necessary resources.}
The line mach-o, but not built for iOS simulator seems like it could be key. How can I resolve this?
The test targets had the iOS Deployment Target setting left as the default value.
In Xcode 9.4, this is equal to "iOS 11.4", yet the tests can still be run on an "iPhone 7 (10.3)" simulator for some reason. In Xcode 10, there seems to be a change in behaviour since the tests no longer run on simulators running iOS versions prior to the default "iOS 12".
In the Project Navigator, select the project file.
Select the Target in the Project configuration window.
Select Build Settings tab, (Basic and Levels)
Scroll down to iOS Deployment Target and then select the desired OS version.
That solved the problem for me.
cheers
rgds Dave

dyld: Symbol not found on iOS8/xcode7 [duplicate]

For the first time I was able to compile my app in Xcode 7 (failed in beta 4 and 5). So, thats good progress I guess.
However, when i load my app on my iPhone 6, iOS 8.4.1, it crashed in the debugger with the following message:
dyld: Symbol not found: _NSArray0
Referenced from: /private/var/mobile/Containers/Bundle/Application/0294DF62-AE80-485D-BB11-8C3A5D39777D/Boxtiq.app/Boxtiq
Expected in: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /private/var/mobile/Containers/Bundle/Application/0294DF62-AE80-485D-BB11-8C3A5D39777D/Boxtiq.app/Boxtiq
Is this something to do with the order of the libraries being linked? Look forward to some advise.
Thanks!
I fixed it by putting this in the podfile. platform :ios, '8.4'
No need to update your device to iOS 9 and lose out on 8.4 testing.
I had the same error and I fixed.
I removed CoreFoundation.framework and Add again with Status "Optional" and works.
If anybody else got this while running unit tests do the following:
Select unit tests target
Go to Build Settings
Search for 'Deployment Target'
Change Deployment Target version to your project's deployment target
That's it!
I also had this problem and I fixed it by adding framework CoreFoundation.framework to Build Settings.
This as a problem on iOS8 build with the new XCODE release, Please remove CoreFoundation.framework and Add it again with Status of "Optional".
I used to have the same error during compilation of a mac os project after updating the Xcode for 7.0 GM version (7A218). Xcode 7 has the 10.11 sdk in it only (you could check that in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs, where it's a MacOSX10.11.sdk).
At compilation time the xcode will link the frameworks from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks, but at runtime from /System/Library/Frameworks/ as I guess.
I have OS X 10.10.5 (14F27) on mac. Either I have my static library that I've built by xcode 7 (MacOSX10.11.sdk as you remember from earlier), which I've linked to my project after. After running I got the runtime error as
dyld: Symbol not found: _NSArray0
I think it's because the library has been compiled with CoreFoundation.framework from mac os sdk 10.11, but at runtime was linked to CoreFoundation.framework from /System/Library/Frameworks/ where version of which is 10.10 (as OS version).
How I fixed this. Friend of mine has xcode 6 yet, I took mac os sdk 10.10 from there (as you remember in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs, name is MacOSX10.10.sdk) and added it to Xcode of mine. Then I rebuilt my static library with 10.10 sdk (you could compile from cli with '-sdk macosx10.10' parameter or set build sdk in Build Settings => Base SDK). After the problem has been solved.
I assume that for the iOS you could apply the same strategy.
I experienced the same exact crash running Xcode 7.0 beta 6 on a device with the first iOS 9 beta installed, the crash however was not occurring while using the simulator.
After updating my iPhone to iOS 9 beta 5, the crash stopped.

Xcode 7 Beta 6, dyld ___NSArray0__ crash

For the first time I was able to compile my app in Xcode 7 (failed in beta 4 and 5). So, thats good progress I guess.
However, when i load my app on my iPhone 6, iOS 8.4.1, it crashed in the debugger with the following message:
dyld: Symbol not found: _NSArray0
Referenced from: /private/var/mobile/Containers/Bundle/Application/0294DF62-AE80-485D-BB11-8C3A5D39777D/Boxtiq.app/Boxtiq
Expected in: /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /private/var/mobile/Containers/Bundle/Application/0294DF62-AE80-485D-BB11-8C3A5D39777D/Boxtiq.app/Boxtiq
Is this something to do with the order of the libraries being linked? Look forward to some advise.
Thanks!
I fixed it by putting this in the podfile. platform :ios, '8.4'
No need to update your device to iOS 9 and lose out on 8.4 testing.
I had the same error and I fixed.
I removed CoreFoundation.framework and Add again with Status "Optional" and works.
If anybody else got this while running unit tests do the following:
Select unit tests target
Go to Build Settings
Search for 'Deployment Target'
Change Deployment Target version to your project's deployment target
That's it!
I also had this problem and I fixed it by adding framework CoreFoundation.framework to Build Settings.
This as a problem on iOS8 build with the new XCODE release, Please remove CoreFoundation.framework and Add it again with Status of "Optional".
I used to have the same error during compilation of a mac os project after updating the Xcode for 7.0 GM version (7A218). Xcode 7 has the 10.11 sdk in it only (you could check that in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs, where it's a MacOSX10.11.sdk).
At compilation time the xcode will link the frameworks from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks, but at runtime from /System/Library/Frameworks/ as I guess.
I have OS X 10.10.5 (14F27) on mac. Either I have my static library that I've built by xcode 7 (MacOSX10.11.sdk as you remember from earlier), which I've linked to my project after. After running I got the runtime error as
dyld: Symbol not found: _NSArray0
I think it's because the library has been compiled with CoreFoundation.framework from mac os sdk 10.11, but at runtime was linked to CoreFoundation.framework from /System/Library/Frameworks/ where version of which is 10.10 (as OS version).
How I fixed this. Friend of mine has xcode 6 yet, I took mac os sdk 10.10 from there (as you remember in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs, name is MacOSX10.10.sdk) and added it to Xcode of mine. Then I rebuilt my static library with 10.10 sdk (you could compile from cli with '-sdk macosx10.10' parameter or set build sdk in Build Settings => Base SDK). After the problem has been solved.
I assume that for the iOS you could apply the same strategy.
I experienced the same exact crash running Xcode 7.0 beta 6 on a device with the first iOS 9 beta installed, the crash however was not occurring while using the simulator.
After updating my iPhone to iOS 9 beta 5, the crash stopped.

Running an iOS application in a device with iOS 5.1.1, using Xcode 5

I am trying to install an iOS application in my iPad running in iOS 5.1.1. When i launch it with Xcode with the development profile, i am getting the following errors :
Xcode cannot install or launch applications supporting the 64-bit
architecture on devices running iOS versions prior to 6.0. This
configuration is supported for distribution through the iOS App Store,
but cannot be used during development with Xcode. To continue, edit
the Run scheme action and select a build configuration that does not
include the 64-bit architecture.
I have tried to change the building architecture by removing the arm64 but i have the same error.
I have tried to install it with testflight by building an ipa with an adhoc provision profile but the same error repeats.
How i can test my application in real device running iOS 5.1.1, building with Xcode 5
You need to make a test target that has no arm64 within valid architectures.
See screenshot, check that you don't have arm64.
Changing the Build Active Architecture Only to Yes for the Debug scheme fixed this for me. This is shown in the screen shot of the accepted answer and it's possible that is the real solution, rather than what the accepted answer describes.

Resources