iOS 10.1 Simulator shows "Application May Slow Down Your iPhone" - ios

When running an app for the first time from Xamarin Studio on an iOS 10.1 Simulator, I got the following message:
app name May Slow Down Your iPhone
The developer of this app needs to update it to improve its compatibility.
The app runs normally, and the message does not appear when I run it for the second time. How can I get rid of this message?

It turned out that the app was only built for the i386 architecture and not for the newer x86_64 one. After changing this in the build settings (to "i386 & x86_64", though I suppose "x86_64" would help as well) it didn't occur anymore.

Ref: https://releases.xamarin.com/stable-release-cycle-8-service-release-0-w-xcode8-1-support/
Remaining higher visibility known issues related to Xcode 8.1
[Xamarin Studio] – 45861 – “May Slow Down Your iPhone … The developer of this app needs to update it to improve its compatibility.” because of default “i386” supported architecture setting in the iPhoneSimulator configuration on new projects
Fix: Change Project options > iOS Build > Supported architectures to x86_64 (instead of the default i386) for the iPhoneSimulator configuration.

Why This Warning Appears
Apple added this warning in iOS 10.1. This article succinctly defines the warning:
"In a bid to push developers to update their apps to 64-bit frameworks, Apple has introduced a new warning message with iOS 10.1. The message reads: “[App Name] may slow down your iPhone”, with a slug, “The developer of this app needs to update it to improve its compatibility.” This message only appears if you're running a 32-bit app.
This won’t affect a vast majority of iOS users as Apple stopped accepting updates to 32-bit apps in June 2015."
Update: Before Cycle 8 Service Release 2, the default Build Architecture for the iOS Simulator Build Configuration did not include the 64-bit architecture.
How To Resolve/Prevent This Warning
For Xamarin apps that were created before C8SR2, you can prevent this error message by manually changing the iOS Build Architecture.
Build Architecture Causing Warning
This iOS Build Architecture does not include the 64-bit Architecture
Build Architecture Resolving/Preventing Warning
This iOS Build Architecture does include the 64-bit Architecture
Update: New Xamarin.iOS Apps
In the latest Stable version of Xamarin, Cycle 8 Service Release 2, the default Build Architecture for new Xamarin.iOS apps is x86_64 for iOS Simulator builds.
i.e. When you create a new app (File -> New), the default Build Architecture is x86_64 for iOS Simulator builds.

Compiling for x86_64
You need to build your app for the x86_64 architecture, whether you're using Xcode or Xamarin. In particular when building from the command line with xcodebuild, set ONLY_ACTIVE_ARCH=NO and be sure not to constrain the target architectures with -arch i386 because you need to allow the compiler to build for x86_64 too.
Verifying your app
To verify that your app is built for x86_64, unzip your IPA file and find the binary. <filename> and <app> are the names of your IPA and app respectively:
unzip <filename>.ipa -d $TMPDIR/app
file $TMPDIR/app/Payload/<app>.app/<app>
If you see Mach-O 64-bit executable x86_64, your app is built for x86_64. You might also see that your app is a universal binary, which is OK too as long as it contains an x86_64 slice:
Mach-O universal binary with 2 architectures
(for architecture x86_64): Mach-O 64-bit executable x86_64
(for architecture i386): Mach-O executable i386

Related

Why does Xcode build for arm64 even when excluded?

I am trying to solve a problem related to Xcode 12, building for iOS Simulator, but linking in an object file built for iOS, for architecture 'arm64'
As an experiment, I wanted to see if I could configure one of my frameworks to only build x86_64 for all cases.
Here is my config:
You can see I have overridden the architectures to be x86_64 and I am excluding arm64. I am also only building active architectures only. There is no way that arm64 should ever be considered during a build.
And yet...
Here is the output of a build the very next moment. It's tons of source files that indicate they are still being compiled for arm64.
Can anyone explain this discrepancy? I am running the latest Xcode, 13.2.1, on a new M1 Max laptop.

object file built for free standing (BlackBerry Dynamics iOS SDK)

I'm having trouble to build an external pre built dependency. It throws the following error:
In /Users/me/Projects/app/ThirdParty/GoodFiles/GD.framework/GD(nondga_helper.o), building for iOS, but linking in object file built for free standing, file '/Users/me/Projects/app/ThirdParty/GoodFiles/GD.framework/GD' for architecture arm64
One of the questions that really bothers me is that I don't have a real idea what "free standing" really means. I thought it had to do with being a fat binary, but after running lipo -thin arm64 GD -o GD (and verifying with -info that it really worked) in one of my build scripts I'm still seeing the same problem.
I also tried to exclude arm64 from the simulator and x86_64 from iOS builds in Excluded Architectures as mentioned elsewhere, but that didn't work either.
Removed the Xcode 12 reason. This already doesn't compile anymore in Xcode 11.
Hi there are new BB certification files you have to add along with the usual GD.Framework files. These are documented on Blackberry website
New Xcode build system
GD.framework
BlackBerryCerticom.xcframework
BlackBerryCerticomSBGSE.xcframework
Legacy Xcode build system
GD.framework
BlackBerryCerticom.framework
BlackBerryCerticomSBGSE.framework
https://docs.blackberry.com/en/development-tools/blackberry-dynamics-sdk-ios/8_1/blackberry-dynamics-sdk-ios-devguide/Steps-to-get-started-And-iOS/rqx1490022241984/Prepare-an-app-to-use-the-static-framework
Check:
Xcode > Preferences > Locations > Command Line Tools
In my case it was set to Xcode 12 after installing Xcode 12. There is NO Xcode 12 proof solution until mid December.

Xcode12 - building for iOS Simulator, but linking in object file built for macOS, file 'dir/SomeFile.a' for architecture x86_64

Getting linker error in Xcode 12 when I am trying to build my large iOS app (hybrid, swift+objc). The application is building fine for real device, but It gives linker error when I am trying to run in Simulator directly with Debug configuration.
I have tried all possible solutions in other post here, but unfortunately it didn't work. Although the error in other post is different. I have checked Build for active architectures only to YES for Debug configs and NO for Release configs.
Other post error,
building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
My error,
building for iOS Simulator, but linking in object file built for macOS, file for architecture x86_64
How can I resolve this issue? I need to run in both iOS real device and Simulator.
Wherever you got your library you should request the library that is compiled for iOS Simulator, not for macOS, although they have the same binary architectures that are returned via lipo -info <file>.
You can verify that your static (.a) or dynamic library (.dylib) is compiled for iOS Simulator using this command:
otool -l <path-to-library> | grep platform
The output means the following:
platform 7 - iOS Simulator
platform 6 - Mac Catalyst
platform 4 - watchOS
platform 2 - iOS
platform 1 - macOS
Here is the full definition of the enum for platform.
Try to add x86_64 in VALID_ARCHS in the User-defined section in Build Settings.

How to create and use a module that implement 64 bit (only) static library

Has anyone successfully created and used a module that implements a 64 bit (only) static library?
Here the situation:
Created a new Appcelerator module project
Downloaded the latest HockeySDK-iOS framework (64 bit only)
Integrated HockeyApp HockeySDK-iOS into my module project
build iOS module project no problem
build (package) appcelerator module no problem (build.py)
create new appcelerator ios App project 5.2.2GA
install module (.zip) into App project
#ERROR Building the app project...
ld: symbol(s) not found for architecture x86_64
The HockeySDK appear to only be built for 64 bit support. I played around with the Architecture flags in my module project - but the Appcelerator app build seems to require the i386 x86_64 architecture.
Or has anyone implemented a current version of HockeyApp SDK for ios?
Please do not suggest: https://github.com/timanrebel/HockeyApp as that project uses HockeyApp iOS SDK v3.8.5 while the current HockeyApp SDK version for iOS is 4.0
As my understanding, "the Appcelerator app build seems to require the i386 x86_64 architecture." means your application now config of supporting both i386 and x86_64 architecture. i386 is the architecture of your desktop that will be required if you want to run on simulator. But your HockeySDK-iOS framework (64 bit only) will not suppose to support i386 architecture. As my guess, you got that missing i386 architecture error while running on simulator. Could you try to config your project support 64 bit only and then run the project on your real 64 bit devices.
In order to fix that error, you can remove your i386 architecture support or download again to make sure that all libraries have been built for i386 architecture.

Error when trying to link fat binary with 64-bit simulator target

I have a static library lipo'd for iOS and OS X with 5 architectures (x86_64, i386, armv7, armv7s, arm64).
The x86_64 architecture was built using the macosx SDK
The i386 architecture was built using the iphonesimulator SDK
The ARM architectures were built using the iphoneos SDK
When I try to link the resulting library in an example App it works when building for a device or for a 32-bit iOS simulator target. But when I try to build it for a 64-bit iOS simulator target I get a linker error:
ld: framework not found CoreServices for architecture x86_64
If I remove the x86_64 slice from the fat library it works for all devices and simulators.
I assume it's because the linker prefers the x86_64 architecture if it's there for the 64-bit simulator. But since it was compiled and linked for the macosx SDK it has the OS X dependencies somehow encoded.
I tried adding a second x68_64 slice for the iphonesimulator SDK but lipo won't let me. Also I tried to find a way to make the simulator use the i386 architecture even for 64-bit builds, but so far no luck.
If absolutely necessary I can create 2 binaries which would solve this but I would really prefer having them in one file. Is there a way to achieve this?
I solved it by only building it for the iOS device and simulator. The 64bit slice of the iOS Simulator SDK equally works for iOS and OS X targets, provided you don't need any other frameworks than what's shared between OS X and iOS (Foundation only in my case).
Project and Pods:
Build Settings ---> Link Frameworks Automatically change YES to NO, and rebuild static library ,it is work!

Resources