Invalid Bundle while submitting swift app + framework - ios

My app is in swift and depends on a private framework (dynamic not static) in swift+obj-C (includes Parse libs) which manages call to Parse.com APIs.
I followed this tuto to build my app in a workspace.
Code is running fine on my iPhone.
Archiving is fine (if I uncheck 'Include app symbols' or it fails like here) but I received a mail from iTunes Connect with this message :
Invalid Bundle - This app includes files that were built with bitcode enabled but without doing an Archive or Install build, possibly from a library or framework that was imported but not built as part of the project. Full bitcode content is only generated in an Archive or Install build.
Once these issues have been corrected, you can then redeliver the corrected binary.
It's been three times I checked and rechecked my build settings and I can't find what I missed.
My conf :
iOS9
Swift2
ObjC
XCode Version 7.0 (7A220)
Parse

Try to disable Bitcode support
Project > Build Settings > All > Build Options > Enable Bitcode = NO
Maybe your library was compiled without Bitcode, but the setting above is enabled in your project by default in Xcode7

Related

Native iOS Unity Integration - AppStore Provisioning Profile causes 'UnityFramework/UnityFramework.h' file not found

I have a native iOS app (Swift) with Unity integrated as a library following this guide:
https://forum.unity.com/threads/integration-unity-as-a-library-in-native-ios-app.685219/
XCode 12.5.1, Unity 2019.4.12f, CocoaPods 1.10.2
For the last 3 days, I am getting this error when I attempt to archive with an AppStore provisioning profile:
/Users/../Bridging-Header.h:9:9: 'UnityFramework/UnityFramework.h'
file not found
Failed to emit precompiled header
'/Users/../Build/Intermediates.noindex/ArchiveIntermediates/appname-testflight-qa/PrecompiledHeaders/Bridging-Header-swift_OMITED-clang_OMITED.pch'
for bridging header '/Users/../Bridging-Header.h'
When I do a regular build using any Provisioning Profile (PP), it builds successfully and I can run on device. When I archive using an Ad-Hoc PP, it succeeds as well.
It only happens during archiving using a manually specified AppStore PP, which I need for doing command-line builds for automated deployments. I've confirmed it happens in both commandline and in XCode editor. I need the Bridging Header so that I can allow native iOS to interact with Unity to pass it some information.
Here's the bridging header:
#ifndef BRIDGING_HEADER
#define BRIDGING_HEADER
#import <UIKit/UIKit.h>
#import <UnityFramework/UnityFramework.h>
#import <UnityFramework/NativeCallProxy.h>
#endif /* BRIDGING_HEADER */
I've tried the following suggestions already on all the other UnityFramework.h not found questions to no avail:
Switch off Parallize Build
Add UnityFramework.framework and/or Unity-iPhone project as a target first in the build process
Cleaned up project, delete DerivedData, deleted/reinstalled Pods
Switched to another scheme that will archive an Ad-Hoc PP, and changed to using AppStore PP
Reintegrated the Unity project all-over again
Build target set to Device (not simulator) through all these tests
I tried switching to: "../UnityFramework/UnityFramework.h" inside the Bridging header
Made Framework optional inside Build Phases - Link Binary With Libraries (and tried to add Copy File Build Phase - this caused an error saying this copy step was being duplicated)
Validated Runpath already includes #executable_path/Frameworks
Tried changing Pods and Project to iOS 12.1 min version and set Pods' Build Active Architecture Only to YES
Any help or suggestions would be very appreciated. I'm completely out of ideas.
The issue resided with naming of Configurations between the primary project and the Unity-iPhone subproject. Since the Unity project didn't have a matching configuration, it chose from one of the other available configurations, in my case, Debug (QA). When the archive went looking for the UnityFramework, it was in the wrong folder.
Essentially, if you have custom Configurations, make sure all of them in your primary project are also in the Unity-iPhone Project with exact same name.

Unity iOS XCode Build Failed: Apple Mach-O Linker Error

I've been trying to build my Unity game to iOS with Admob, Unity IAP, and Firebase Analytics.
Unity Version: 5.6.2f1 Personal
Xcode Version: 8.3.3
Steps I've completed:
Enabled IAP and Analytics in Unity Service tab, Imported IAP package
Imported Firebase Analytics Package
Imported Admob unity package
Created new Firebase project in the web portal. Downloaded GoogleService-Info.plist file
Put .plist file in Assets folder.
Ensured my player settings in Unity were correctly configured (Bundle Identifier, Version, IL2CPP set, Architecture: Universal, Device SDK set).
Made Xcode project folder (Release mode set in build settings). Build succeeded, no errors.
Opened terminal window and ran "pod init" in Xcode project folder root
Ran "pod 'Firebase/Core'", "pod install". Succeeded
Opened the .xcworkspace file from Xcode
Changed "Enable Modules (C and Objective-C)" to "Yes" in Build Settings for both target and project files.
Downloaded the GoogleMobileAds.framework (from the GoogleMobileAdsSDK zip)
Added the GoogleMobileAds.framework to the list of frameworks in "Build Phases"
Added AdSupport.framework
Added "-ObjC" to "Other Linker Flags" in both Target and Project files.
Cleaned Project
Build Project, Build failed due to linker errors
I've also tried upping the deployment target to 8.0 rather than 6.0 in the general settings and PodFile, but it didn't remove the errors.
Any help would be appreciated. I think I'm just missing a step somewhere in the Xcode configuration but I can't seem to figure it out.
Fixed it! It was a simple mistake on my part. I downloaded an unofficial Google Admob Unity package. This created an "AdmobAPI" folder in my Assets/Plugins which contained the files causing the linker errors.
I didn't notice it right away because this folder was never getting overwritten when I reimported the official packages. It finally caught my eye when I was comparing the directories between my project and Google's sample project which I installed the official packages to.
So in short, double check what you're importing and scan your directories thoroughly if you run into build errors. At this point in time, little to no modification should be needed in Xcode (I didn't need any of those extra steps); Unity does nearly all the work.

error: Invalid bitcode version (Producer: '800.0.35.0_0' Reader: '703.0.31_0')

When I try to Archive my application on Xcode 7.3.1, I am getting following error:
error: Invalid bitcode version (Producer: '800.0.35.0_0' Reader:
'703.0.31_0') clang: error: linker command failed with exit code 1
(use -v to see invocation)
I was able to successfully Archive my app yesterday, can any one please help me?
i had this error before ...
you may try the following solution it worked for me
search for bitcode keyword in app --> Build Settings and change it to NO
then archive again -->
it should work fine now
Install Xcode 8:
https://developer.apple.com/download/
Xcode 8 GM seed may be used to submit apps to the App Store.
More info:
In my case I updated to the latest Facebook iOS SDK 4.15.1. Since that library was updated with Xcode 8 and I was still using Xcode 7.3.1 it caused the error.
https://developers.facebook.com/docs/ios/change-log-4.x
Updated for Xcode 8 GM and iOS 10.
So, double check 3rd party libraries.
Or if you don't mind disabling bitcode:
Go to build settings search bitcode and change "Enable Bitcode" to "No".
I also faced the same problem, and as suggested by #Nate,
the issue was because of a third party SDK integrated in our project using Cocoapods.
To help me figure out which one of the 15 pods i had in the project was responsible, i did the following:
Create a new xcode project
Copy the Podfile from your original project to the newly created project's directory
Do pod install
Remove one or more of the pods⋆
Archive the new project, and see if it succeeds, if not repeat step 4 till you are able to archive
⋆(you can also try something like binary search, wherein you delete the first half pods in your Podfile and see if the new project archives)
Once you've figured out the library causing the issue, keep downgrading the library by explicitly specifying the version in Podfile, until the project archives successfully.
And then you can use that version of the library to archive and upload to the app store.
If you are using lib or pod that mean that one of them built by a higher version of your current Xcode, you can either update your code or return back to the previous version where the pods were built by your current version.
If you ran pod update check the pods updated if you ran pod install check the dates of the pods comparing to the release date of your Xcode that will will lead you to the responsible pod.
I got it while I was building using Xcode 8.2.1 and the pod built by Xcode 8.3.1
I also faced this error: Invalid bitcode version (Producer: '800.0.24.1_0' Reader: '703.0.31_0') I have googling so many but unable to find the proper solution. I tried Myself and solved this probable
In my case this error occurs after adding FBSDK by drag and drop that we all usually do.
You can resolve this problem by following these steps:
Delete all pod script in build Phases.
Delete the dragged FBSdks file from the project.
Exit xcode and delete 3 things "Pod folder","Podfile.lock" and "Projectworkspace"
Search and add FBSDK pod link in podfile
Install the pod again by using terminal.... now open Xcode archive your project build.
good solutions, but disabling bitcode worked for some people.
edit :- it worked for me too.
but in future your app might be in problem or (build not optimised by Appstore) if your project is **Bitcode Disable **.
Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.
Note: For iOS apps, bitcode is the default, but optional. If you
provide bitcode, all apps and frameworks in the app bundle need to
include bitcode. For watchOS apps, bitcode is required
So thats why try to figure out error solutions right way.
The error basically says:
The static linker could not correctly link a certain bitcode bundle, which was
produced using Producer: '902.0.39.2', and is being read using Reader:
'900.0.37'.
You can look up at https://gist.github.com/yamaya/2924292 to identify the Xcode versions for the corresponding compiler versions. In the current case, the reader (our Xcode version) is Xcode 9.0, whereas the producer (Xcode version of typically a third party SDK) is Xcode 9.4. The incompatibility between the two is the root cause of this issue.
You may either:
turn off the bitcode as discussed in other answers, or
roll-back the SDK to a previous version that worked well, or
update your codebase to use the newer Xcode version.

ITMS-90086 Missing 64-bit support

We have a Xamarin application that we are trying to deploy to the apple appstore, but when we try to submit the application for review we get the exception ITMS-90086 Missing 64-bit support. Here is a screenshot:
Here are the build options for my Xamarin project showing that ARMv7 + ARM64 is selected for the Supported architectures setting.
Note from the screenshot that the configuration is set to Release; I did read in one of the Xamarin appstore guidelines that this must be set to Appstore, but I do not have that configuration in my project. (See screenshot below). Could this have anything to do with the error we are getting?
We are able to set the Active configuration to Appstore\Device in the Project menu and have done so. So Appstore configuration is just not available in the project build options.
We also make use of 4 statically linked libraries which we recompiled in Xcode after updating to iOS SDK 8.3. Here is a sample screenshot of the build settings for one of our statically linked libraries.
Here is a summary of the actions that we performed to try get our application submitted:
Upgraded Xcode to the latest version with iOS 8.3 SDK installed
Upgraded to the latest version of Xamarin Studio
Upgraded to latest version of Xamarin.iOS (Version: 8.8.2.4)
Migrated the application to the Unified API
Recompiled our static libraries in Xcode using iOS 8.3 SDK
Used btouch-native to import the libraries into our Xamarin project.
Changed the Active configuration to 'Appstore\Device`.
Configured the correct provisioning profile in the iOS bundle signing section
Selected ARMv7 + ARM64 for the Supported architectures build setting.
We can compile that application with ARM64 architecture specified in the build settings; we can create the archive; we can even validate the archive in Xcode and it passes the validation. But when we do the submission we get this error.
Does anyone know why this error occurs and what we could do to try resolve it?
The problem is that your project file doesn't have an AppStore configuration.
To solve:
Right-click your project => Options.
Select Build/Configurations.
Select Distribution/iPhone, and Copy to:
Name: AppStore
Platform: iPhone
OK
Now you should be able to select the AppStore configuration and set the architecture properly.

xcode 4.2 build and archive issues in iTunes

i have upgraded my xcode to 4.2 and tried to build my old project using new xcode.
i changed the following settings in new xcode -
Architectures -> armv6 armv7
Base SDK - ios5
Compiler - > LLVM GCC 4.2
iOS Deployment Target -> iOS 3.1
i was able to build and install it in device(5.0 ios) but when i tried to make an distribution build using archive, it failed to install in the devices showing invalid entitlements both for ios4 and ios5.
when i googled it i found that in order successfully intall set
Build Active Architecture Only - > NO
After this i got success to install my distribution build .ipa through iTunes in iphone 3gs/4(both 4 and ios5) but it still showing invalid entitlements in iphone3g(3.1.3ios).
i have static libraries in my project as well.
Please help me figure out how to create an build which should install in 3.1 to 5.0 ios.
Thanks
You will have to plug your device and open organizer, than it will ask to install IOS3.0 - 3.2.2 Device Debugging Support, install it and try again, it works for me.

Resources