Export IPA error on Xcode 7 in El Capitan - ios

Since Xcode 7 and El Capitan I can't export an archive into an IPA file. When I finish the flow Export... > Save for Ad Hoc Deployment > Export (button) it displays the following error: Coulnd't find any platforms at all in /Applications/Xcode.app/Contents/Developer/Platforms
EDIT:
This would be the relevant part of the logs
In IDEDistribution.standard.log
{
code = 2109;
description = "couldn't find any platforms at all in /Applications/Xcode.app/Contents/Developer/Platforms";
info = {
};
level = ERROR;
}
In IDEDistribution.critical.log
2015-10-06 06:50:04 +0000 [MT] Presenting: Error Domain=IDEFoundationErrorDomain Code=1 "couldn't find any platforms at all in /Applications/Xcode.app/Contents/Developer/Platforms" UserInfo={NSLocalizedDescription=couldn't find any platforms at all in /Applications/Xcode.app/Contents/Developer/Platforms}
EDIT 2:
Listing Platforms directory:
$ ls -l /Applications/Xcode.app/Contents/Developer/Platforms
total 0
drwxr-xr-x 9 root wheel 306 2 oct 10:12 MacOSX.platform
drwxrwxr-x 8 root wheel 272 2 oct 10:12 WatchOS.platform
drwxr-xr-x 6 root wheel 204 2 oct 10:13 WatchSimulator.platform
drwxr-xr-x 8 root wheel 272 2 oct 10:13 iPhoneOS.platform
drwxr-xr-x 5 root wheel 170 2 oct 10:14 iPhoneSimulator.platform

deselect "Export from bitcode" checkbox in dialog when exporting IPA. If checked it means that you want to test a build created from bitcode. See more details here

Change the deployment target .
Clean the project
Build the project & then archive it . You will get it.

Also you can remove this error by following below steps:
1) Go to Targets
2) Build settings > Set NO to "Enable Bitcode"
3) Try Archive again.

Related

Xcode 13 quick help window not launch on custom objects

Ever since I downloaded Xcode 13 I have been unable to see the quick help window (option click) for objects/functions/variables I have created.
I can see the quick help window for other swift frameworks (option clicking tableView works, for example). Just not for my own.
I have tried
running this in command line:
$ defaults delete com.apple.dt.Xcode WebKitJavaScriptEnabled
deleting this:
~/Library/Caches/com.apple.dt.Xcode
running this:
$ defaults delete com.apple.dt.Xcode IDEIndexDisable
This is what I see when I run:
$ cd ~/Library/Developer/Xcode/DocumentationCache/
$ ls -al
total 0
drwxr-xr-x 4 myname staff 128 Sep 21 13:13 .
drwxr-xr-x 13 myname staff 416 Sep 24 20:38 ..
drwxr-xr-x 3 myname staff 96 Apr 28 10:49 v187
drwxr-xr-x 3 myname staff 96 Sep 21 13:13 v202
Anyone know of any fixes?
A restart of the machine solved the issue for me. Xcode then installed components and built the quick help for Apple's documentation and the documentation in my own code.

How to setup Jenkins Xcode plugin for workspaces?

I am green to the iOS app development space. I need to setup a build in Jenkins for a new Swift application I built. As part of that, I used Cocoapods to manage dependencies which in turn, meant I now had a workspace instead of a simple project.
I'm now trying to build this application as part of our pipepline and have hit the following error:
FATAL: Since there are multiple projects in the workspace, you must be specify the location of the target project as Xcode Project File.
Build step 'Xcode' marked build as failure
Finished: FAILURE
The root of my project looks as follows:
$ ls -la
total 32
drwxr-xr-x 14 mcbint staff 448 15 Jan 15:16 .
drwxr-xr-x 3 mcbint staff 96 15 Jan 14:33 ..
drwxr-xr-x 13 mcbint staff 416 16 Jan 11:11 .git
-rw-r--r-- 1 mcbint staff 108 15 Jan 14:56 .gitignore
-rw-r--r-- 1 mcbint staff 501 15 Jan 14:56 Podfile
-rw-r--r-- 1 mcbint staff 379 15 Jan 14:56 Podfile.lock
drwxr-xr-x 9 mcbint staff 288 15 Jan 15:16 Pods
-rw-r--r-- 1 mcbint staff 666 15 Jan 14:56 README.md
drwxr-xr-x 10 mcbint staff 320 15 Jan 14:56 mcb-phoneagent-ios
drwxr-xr-x 5 mcbint staff 160 15 Jan 15:16 mcb-phoneagent-ios.xcodeproj
drwxr-xr-x 4 mcbint staff 128 15 Jan 14:56 mcb-phoneagent-ios.xcworkspace
drwxr-xr-x 4 mcbint staff 128 15 Jan 14:56 mcb-phoneagent-iosTests
drwxr-xr-x 4 mcbint staff 128 15 Jan 14:56 mcb-phoneagent-iosUITests
drwxr-xr-x 2 mcbint staff 64 15 Jan 15:07 test-reports
I have setup the project in xcode as follows:
On my development machine I can successfully build the application with the command:
xcodebuild -workspace mcb-phoneagent-ios.xcworkspace -scheme mcb-phoneagent-ios
Does anybody see anything I've setup incorrectly?
This is how I resolved this issue when i ran into it:
Make sure that you have your scheme container set to the workspace (not the project. This can be checked in Xcode in Product -> Scheme -> Manage Schemes, then look in the column titled "Container")
confirm that the xcshareddata is in the workspace directory that Jenkins is using.
In Jenkins Under the General build settings of the Xcode there is a "Settings" button
click on it and find the Xcode schema file text box.
Fill that box in with the name of the xcsheme file you want to use for the given workspace that was entered as the Xcode Workspace file (in your case I'm guessing it would be mcb-phoneagent-ios).
Since you use Cocopod, you need to use the *.xcworkspace file, not the *.workspace,
and from personal experience much easier to archive and use *.app files with jenkins instead of letting it to build for u the projects

Gradle error when building the android-support-test project

I'm trying to build the Android Support Testing project. I'm following these instructions. I've got my build env setup and I've synced the Repo. When I try to build the project I get this error.
$ pwd
/Volumes/android/android-support-test
$ ls -l
-r--r--r-- 1 me staff 87 Feb 5 12:56 Makefile
-rw-r--r-- 1 me staff 749 Feb 5 16:14 android-support-test.iml
drwxr-xr-x 11 me staff 374 Feb 5 12:56 build
lrwxr-xr-x 1 me staff 31 Feb 5 12:57 build.gradle -> frameworks/testing/build.gradle
drwxr-xr-x 16 me staff 544 Feb 5 12:57 external
drwxr-xr-x 4 me staff 136 Feb 5 12:57 frameworks
drwxr-xr-x 3 me staff 102 Feb 5 16:14 gradle
-r-xr-xr-x 1 me staff 5884 Feb 5 12:57 gradlew
lrwxr-xr-x 1 me staff 35 Feb 5 12:57 local.properties -> frameworks/testing/local.properties
drwxr-xr-x 3 me staff 102 Feb 5 16:17 out
drwxr-xr-x 7 me staff 238 Feb 5 12:57 prebuilts
lrwxr-xr-x 1 me staff 34 Feb 5 12:57 settings.gradle -> frameworks/testing/settings.gradle
$ ./gradlew assembleDebug
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: http://gradle.org/docs/2.5/userguide/gradle_daemon.html.
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* Where:
Build file '/Volumes/android/android-support-test/frameworks/testing/build.gradle' line: 16
* What went wrong:
A problem occurred evaluating root project 'android-support-test'.
> Could not read script '/Volumes/android/android-support-test/version.gradle' as it does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.31 secs
The version.gradle file is in /Volumes/android/android-support-test/frameworks/testing but build.gradle is looking for it in /Volumes/android/android-support-test.
I think the aliasing of build.gradle -> frameworks/testing/build.gradle is not working correctly. Am I missing something?
The frameworks/testing Repo project should have contained an additional sym link, but you can just create it yourself:
ln -s frameworks/testing/version.gradle version.gradle
h/t to John Lombardo on the Android Testing Support Library google group

iOS is it a static or a dynamic framework?

This might sound like a silly question but If you have a thirdParty.framework file, can you tell if it's static or dynamic? I mean, do they look different if you look inside?
It can be either.
Only iOS8+ will allow dynamic frameworks in the app bundle, however.
The way to find out is to look in the .framework and use the file command on the main file:
$ cd iOS/Crashlytics.framework
$ ls -l
total 9984
-rwxr-xr-x 1 andy staff 4710656 11 Sep 17:11 Crashlytics
drwxr-xr-x 8 andy staff 272 11 Sep 17:11 Headers
-rw-r--r-- 1 andy staff 1553 11 Sep 17:11 Info.plist
drwxr-xr-x 3 andy staff 102 11 Sep 17:11 Modules
-rwxr-xr-x 1 andy staff 146164 11 Sep 17:11 run
-rwxr-xr-x 1 andy staff 241688 11 Sep 17:11 submit
$ file Crashlytics
Crashlytics: Mach-O universal binary with 5 architectures
Crashlytics (for architecture armv7): current ar archive random library
Crashlytics (for architecture armv7s): current ar archive random library
Crashlytics (for architecture i386): current ar archive random library
Crashlytics (for architecture x86_64): current ar archive random library
Crashlytics (for architecture arm64): current ar archive random library
Where ar archive means "static library".
Alternatively, a "dynamic" framework will look like this and explicitly state that it's dynamically linked.
$ cd /Library/Frameworks/iTunesLibrary.framework/
$ ls -l
total 40
lrwxr-xr-x 1 root wheel 24 10 Sep 17:38 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 root wheel 24 10 Sep 17:38 Modules -> Versions/Current/Modules
lrwxr-xr-x 1 root wheel 26 10 Sep 17:38 Resources -> Versions/Current/Resources
drwxr-xr-x 4 root wheel 136 10 Sep 17:41 Versions
lrwxr-xr-x 1 root wheel 22 10 Sep 17:38 XPCServices -> Versions/A/XPCServices
lrwxr-xr-x 1 root wheel 30 10 Sep 17:38 iTunesLibrary -> Versions/Current/iTunesLibrary
$ file Versions/Current/iTunesLibrary
Versions/Current/iTunesLibrary: Mach-O universal binary with 2 architectures
Versions/Current/iTunesLibrary (for architecture i386): Mach-O dynamically linked shared library i386
Versions/Current/iTunesLibrary (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
I use this command to list all STATIC Frameworks from a path with a list of frameworks:
find -E . -type f -iregex ".*\.framework\/[^./]*" -exec file {} \; | grep ': current ar archive' | sed 's/.*\/\(.*.framework\).*/\1/'

Xcode 6 Code Coverage, no GDCA files "cannot open: No such file or directory"

I am trying to generate GDCA files using gcov in XCode, and have been using BubbleFoundry and this post as guides.
I have a separate test target created, which prints a bunch of lines when done like:
profiling: /Users/me/Library/Developer/Xcode/DerivedData/
MyProject-HASH/Build/Intermediates/MyProject.build/Debug-iphoneos/
MyProject Tests.build/Objects-normal/
armv7/mysource.gcda: cannot open: No such file or directory
After trying the instructions in both posts I tried setting up CoverStory, which resulted in the same error message.
My permissions in that directory:
8 -rwxrwxr-x 1 me staff 474 Nov 5 21:54 mysource.d
8 -rwxrwxr-x 1 me staff 220 Nov 5 21:54 mysource.dia
144 -rwxrwxr-x 1 me staff 71136 Nov 5 21:54 mysource.gcno
296 -rwxrwxr-x 1 me staff 148752 Nov 5 21:54 mysource.o
I previously tried running the permissions script from BubbleFoundy, but I still get the cannot open error (a.k.a. gdca files not written).
Apparently, I was generating GCDA files to the phone, which weren't being found. I fixed this by manual deleting all the directories in /Users/me/Library/Developer/Xcode/DerivedData/MyProject-HASH/Build/Intermediates/MyProject.build/ and then rerunning tests in the simulator.

Resources