Bitcode WatchOS3 - how to generate - ios

I am attempting to upload a watchOS3 app to the apple store, however I received a rejection (from apple) thats similar the below
Invalid Executable - The executable 'someWatch Extension' does not contain bitcode.
Once these issues have been corrected, you can then redeliver the corrected binary.
How can I resolve this? It seems like bitcode is mandatory as there is no longer a build setting in Xcode for my watch application to simply "Enable Bitcode=No".
I have also tried looking into running swiftc -embed-bitcode *.swift from my Watch Extensions directory, but I receive the below
MyController.swift:9:8: error: no such module 'WatchKit'
import WatchKit
I really have no clue what to do from here and it UBER frustrating with the lack of documentation out there for watchOS3 to get around this. PLEASE HELP

For me the problem was that ENABLE_BITCODE=NO was set on the project level, and even though Watch did not have it set and should have resolved to YES which is the default for WatchOS, it was still resolved to NO - because of the inherited value from the project.
To resolve it, I removed the ENABLE_BITCODE value at the project level.
(to do this, select it in the Project Build Settings and press delete button on your keyboard so that text loses its boldness).

Related

iOS - Missing CFBundleIconName in Xcode 9.2

I am uploading build to release app using Xcode 9.2 built with iOS 11 SDK. Binary is archived and uploaded successfully, but I get the following email back.
Dear developer,
We have discovered one or more issues with your recent delivery for
"". To process your delivery, the following issues must be corrected:
Missing Info.plist value - A value for the Info.plist key
CFBundleIconName is missing in the bundle ''. Apps that provide icons
in the asset catalog must also provide this Info.plist key. For more
information see
http://help.apple.com/xcode/mac/current/#/dev10510b1f7. Once these
issues have been corrected, you can then redeliver the corrected
binary.
Regards,
The App Store team
I found a solution.
Missing CFBundleIconName in Xcode9 iOS11 app release
But i need little bit more. I don't want to use *.xcassets file for app icon. I want to use image in xCode project folder for app icon.
Is it possible in xCode 9.2? if yes then how?
Haven't seen this listed on any of the other posts but this was my issue.
Make sure to check the target membership of your assets directory! If you do not correctly link the membership here, you will get this same super-generic error(Apple should do something about the error messages).
The target membership should correlate directly to targets for which you are using the icons. For example, I use this single directory for both my main app, and watch app assets, you must specify this by selecting the appropriate member.
There is a direct option not to use app icon from Assets

Can only upload to Apple App Store with bitcode set to yes

I was having some trouble uploading my Ionic Ios App to the App Store through Xcode(v 7.2).
I was constantly faced with the error: "upload failed: You are not authorized to use this service for provider XXXXXX"
After some careful problem solving I was able to resolve that I needed to have "Enable Bitcode: Yes" under my project's Target. This allowed me to upload the app through Application Loader by exporting the app with bitcode attached.
My question is in terms of my wanting to better understand what is going on under the hood here.
What difference did the enabling of bitcode make to allow the app to upload vs not having it? I tested this out to confirm and this one change was the difference in the success and failure of uploading.
Thanks.
What difference did the enabling of bitcode make to allow the app to upload vs not having it? I tested this out to confirm and this one change was the difference in the success and failure of uploading.
->You don't need to Set Yes to bitcode for iOS apps. Enabling bitcode might have simply recompiled your libraries ( above error looks like an profile error). To prove this theory, disable bitcode (Set Value to No) recompile and upload on iTunes.
Refer to this link
https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html
For iOS apps, bitcode is the default, but optional. For watchOS and tvOS apps, bitcode is required. If you provide bitcode, all apps and frameworks in the app bundle (all targets in the project) need to include bitcode.

How to debug "Invalid Bundle" error which happens only after submitting to app store

I have a lot of frameworks in my app. App works fine in adhoc/enterprise release. Only if I submit to the app store for testflight testing I get this error email from apple:
Dear developer,
We have discovered one or more issues with your recent delivery for "My app's name here". To process your delivery, the following
issues must be corrected:
Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path.
Once these issues have been corrected, you can then redeliver the corrected binary.
Regards,
The App Store team
there is no specific information here. How can I debug it?
Got an answer from Apple Developer Technical Support which says it is a bug on Apple's side. this is the suggested workaround below which did not work for me:
To diagnose this issue, you should export the IPA you are sending to
the App Store from Xcode. Since IPAs are zip files, you can
decompress it by right clicking and saying Open With > Archive
Utility. You should find your main executable inside the unzipped
folder structure and run otool at the command line to see the library
list: otool -L
The list of paths you get should match what you find inside of your
IPA. All of your libraries should start with #rpath. A simple
comparison of everything in this list with the unzipped IPA folders
should reveal what is missing.
Once you know what is missing, go to your Xcode build phases setup.
There should be a build phase for either Copy Files or Embed
Frameworks that includes the missing library — you should just add the
library to the list. If you don’t see either of these build phases,
you can recreate it by adding a new Copy Files build phase, setting
the Destination to Frameworks, and adding the library to the list,
ensuring that Code Sign On Copy is checked.
If you don’t find anything missing in your main binary, make sure to
do the same search on any other binaries you may have, like for a
watchOS app or an iOS app extension.
If you find that all of the frameworks are in this build phase, please
take a look at the Embedded Binaries section of your app target’s
General page, and let me know if you see multiple levels of ../ next
to the binary that you found is missing.
Please let me know if it works for you!
I have encountered the same issue when uploading an app with watch support to the app store.
I was able to solve it with the hint from the first answer, using otool -L to analyze the binary from the ipa or xcarchive.
However, the problem was not with my frameworks (at #rpath) but with a swift lib. I noticed that libswiftWatchKit.dylib was missing in the frameworks folder.
The solution that worked for me was as simple as to set EMBEDDED_CONTENT_CONTAINS_SWIFT=YES in the build settings of the watch app (or the watch app extension, but not both). After that, all necessary swift libraries were correctly copied to the watch app path in the archive and upload to app store was working correctly.
Apparently, the watch app works and upload passes if you provide the necessary swift libraries only in the main app's folder.
After adding the custom Swift framework to my project I got this email after uploading the app to iTunes connect.
I got this email from iTunes store,
Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path.
The fix is simple for this issue,
Step 1: Make sure your Custom framework is added to Embedded Binaries in General tab of your target.
Step 2: Under build settings,
Set Always Embed Swift Standard Libraries = Yes for your main project target.
And Set Always Embed Swift Standard Libraries = No for your custom framework target.
This solved my problem and I was able to upload binary to iTunes connect.
Ref
Tried all the above solutions and did not work for me.
I was experiencing this issue in Xcode 10.1 recently and all my frameworks were referenced correctly (did otool -L and everything lined up).
Seems there were some changes in the apple validation process, may be a bug, may not be on Apple's end, but all my prior builds uploaded and validated fine -- and I did not add any new frameworks since.
Upon uploading the binary to iTunesConnect, I'd see the following error:
Invalid Bundle - One or more dynamic libraries that are referenced by
your app are not present in the dylib search path.
Invalid Bundle - The app uses Swift, but one of the binaries could not
link to it because it wasn't found. Check that the app bundles
correctly embed Swift standard libraries using the "Always Embed Swift
Standard Libraries" build setting, and that each binary which uses
Swift has correct search paths to the embedded Swift standard
libraries using the "Runpath Search Paths" build setting.
MY SOLUTION:
After days of debugging, what worked for me was to disable 'Include bitcode for iOS content' upon uploading the archive from Xcode organizer. Seems that this option modifies the binary which caused the validator to fail.
Or you can disable bitcode in your Build Settings
My Problem:
I had the same error with embedded frameworks.
The App project has Custom Framework project
Inside the Custom Framework project is another Custom Framework project
The app built to the simulator and to devices with no problem but failed the Apple test, returning "Invalid Bundle".
I inspected the package just like Taha had been told to by Tech Support and everything was present and correct!
My Solution:
I restructured the project so that the two custom frameworks sit side by side and one is no longer embedded within the other.
This looks to be an Apple validation problem since everything works fine on devices and the simulator but the work around was straight forward.
In my case, in the build settings, this was fixed when I added the following to the build settings for the library:
DYLIB_INSTALL_NAME_BASE = #rpath
The clue was a linker warning: 'YourLibrary has an install name beginning with “/”, but it is not from the specified SDK'
Had same issue. This happened to me because one of my Framework target was added to main target in "Link Binary With Libraries" but was not added to "Target Dependencies" and "Embedded Binaries"
I also received a similar mail from Apple:
Dear Developer,
We identified one or more issues with a recent delivery for your app,
"********. Please correct the following issues, then
upload again.
ITMS-90562: Invalid Bundle - One or more dynamic libraries that are
referenced by your app are not present in the dylib search path.
Best regards,
The App Store Team
I used my own framework for my watch app. I solved this issue by changing the framework option to "Embed Without Signing" in the Extension Target. The default option was "Do Not Embed".
I had the same problem, it was due to one framework not being present in the Frameworks subfolder in the app bundle.
I fixed it by adding a Copy Fields build phase, and adding the missing .framework file there.
This error message is also addressed in Apple Technical Note TN2435
Embedding Frameworks In An App: https://developer.apple.com/library/archive/technotes/tn2435/_index.html
You can find the error message under the heading "Missing Framework Bundle" with troubleshooting steps.
We had the same problem, and even after going through all the steps (see "Missing Framework Bundle"), the only thing that worked was disabling Bitcode.
So I struggled on this for two days. What it turned out to be was I had UITests checked in Archive for the Build for the Scheme I was archiving.
After unchecking it from Archive, re-archiving it, validating it (although validating it before always passed), and "Upload to AppStore" I did not get the e-mail from Apple informing me of Invalid Swift Support. Instead I got the e-mail that it'd been processed and is good to go!
In my case, I've had to add a framework from Notification App Extension to the main target (embed & sign in the main target, do not embed in the extension) - even though there was no mention about it in otool -L output.
Funny thing that Iterable official doc says that the framework should be embedded & signed in the extension - which would lead to another upload problem because of nested bundles.

ITC.apps.assetvalidation.BITCODE_IMBALANCE_ERROR.error.message

I am having a problem submitting my iOS application to review queue. It keeps loading and throwing me error like this.
ITC.apps.assetvalidation.BITCODE_IMBALANCE_ERROR.error.message
Any ideas how to resolve this?
I'm afraid there's not much information about this issue. All the stuff I've read about is from yesterday or today. This thread on the apple message board is what made most sense to me:
https://forums.developer.apple.com/thread/48023
It implies that there might be some issue on the Itunes Connect backend. It makes sense to me because I've already managed to do some releases on my app before, and the BITCODE flags were not changed before that. So it's either a change in the bitcode policies or some random error.
In any case, we'll probably have to wait until Apple clarifies it. I'd suggest to stay tuned to that thread on their forum :)
EDIT: I figured it out!!
I'm using CocoaPods, and the Pods project had the "Enable bitcode" option enabled for all targets, while my app had it disabled. That means that the frameworks were being generated with the arm64-bitcode architecture instead of the arm64-machinecode that my project requires. Putting the "Enable bitcode" to "No" for all the targets inside the Pods project does the trick.
At least, it worked for me. Too bad apple provides no feedback on this, because it looks like a recent change. I think there's another option that could work without changing the project settins: try disabling the "Include bitcode" checkbox on the Organizer, after pressing the "Upload to App Store" button.
Edit (again): Disabling the "Include bitcode" checkbox in the organizer definitely works :)
Regarding bitcode deprecation in Xcode 14. If you're using fastlane make sure to remove include_bitcode: true from your build_app call
Use of bitcode is deprecated starting in Xcode 14. You can checkout the Xcode 14 Release Notes deprecation.
So, we are free to remove the uploadBitcode key from the exportOptionsPlist plist file. And also make sure that your all app modules and external library's Enable Bitcode option in the build Settings should be no, then you will be able to upload your app to iTunes connect without getting any error or warning.

XCode:4.6 Lion:10.8 IOS 6.1 error: SBTarget is invalid

XCode:4.6 Lion:10.8 IOS 6.1 error: SBTarget is invalid , how to solve this?
After hundreds of times testing, I find a way that can help the programme run,
here is it:
When you first meet SBTarget is invalid, choose Product --> Clean
Run again, this time you may also get error: SBTarget is invalid, it doesn't matter.
Turn off the XCode totally, 'totally' means that the Xcode icon should not appear in the Dock.
Double click your project file(xxx.xcodeproj , the blue one) to start Xcode, run again. (Do not Clean this time), and it runs ok.
Let me know if this can help you or you have any other methods. Thx
I had this issue while incorporating the Facebook SDK into my app. The error would alternate between SBTarget is invalid and telling me that my architecture was incompatible with my device so it would not launch. If I followed alexqinbj's advice it would run the app once but then it would go right back to having the same error again. I tried messing with architectures and build settings and removing derived data but in the end it really was just a duplicate file in my file structure. Facebook told me to add their SDK and then to add a folder (that the SDK file already contains). Once I saw that it was just a matter of removing the duplicate file. I've heard of this error happening with duplicate plists as well. Good luck
Indeed, the root cause (in Facebook integration) is the duplicate resources in the Facebook SDK (as per their instructions). When I deleted the resource files (remove references only), this problem went away permanently. Not sure why Facebook instructions ask you to drag the resources bundle over to the Facebook SDK framework you just brought in...
TARGETS -> Build Phases, remove info.plist from Copy Bundle Resources. Clean and run. It works for me.
Unfortunately, the accepted answer didn't work for me. I can provoke this error with 100% certainty. It is not necessarily an internal consistency issue with XCode that can be resolved through cleaning, rebooting and rebuilding.
SBTarget is Invalid is an internal XCode error. It happens when attaching a debugger and the architectures specified in the XCode project do not match up with the binary.
On OS X, you can diagnose this by going to the binary on the hard drive and typing:
lipo -info <bin>
Then comparing this to the build settings ARCH and ONLY_ACTIVE_ARCH. They must match. It is not enough for ARCH to be a subset of the possible architectures contained within the binary.
There are any number of reasons why they might not match up. Here are some suggestions:
You are using an external build scheme. XCode therefore does not dictate the contents of the binary. The build settings merely tell XCode what to expect when launching GDB or LLDB.
The executable specified for launch in the scheme is not correct. If it can't find the executable, the architectures will not be present.
This error has a very distinct cause in my case. Whenever "Expand Build Settings in Info.plist File" was set to "NO" in Xcode's "Build Settings", this message came up. Will submit rdar to Apple.

Resources