Can't upload iOS app to store with specific framework - ios

The last week I've been dealing with properly adding frameworks into my iOS app so that I can upload it to the app store. I took out some dynamic frameworks, and replaced them with static ones. However, one of the frameworks I'm using is static (which I've double checked using the method explained here), but the app store is still not allowing me to upload with it. I'm getting the following message when doing so:
UserInfo={NSLocalizedDescription=Item at "/Users/aaronmednick/Library/Developer/Xcode/Archives/2018-06-20/myApp 6-20-18, 3.01 PM.xcarchive/Products/Applications/myapp.app/Python.framework/Versions/2.7" did not contain a "archived-expanded-entitlements.xcent" resource.}
For reference here's my output for checking that the Python.framework I'm using is a static one:
Aarons-MacBook-Air:Python.framework aaronmednick$ ls -l
total 0
lrwxr-xr-x 1 aaronmednick staff 24 Jun 19 20:58 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 aaronmednick staff 23 Jun 19 20:58 Python -> Versions/Current/Python
lrwxr-xr-x 1 aaronmednick staff 26 Jun 19 20:58 Resources -> Versions/Current/Resources
drwxr-xr-x# 4 aaronmednick staff 128 Jun 19 20:58 Versions
Aarons-MacBook-Air:Python.framework aaronmednick$ file Python
Python: Mach-O universal binary with 5 architectures: [i386:current ar archive] [arm64]
Python (for architecture i386): current ar archive
Python (for architecture armv7): current ar archive
Python (for architecture armv7s): current ar archive
Python (for architecture x86_64): current ar archive
Python (for architecture arm64): current ar archive
Any help with this issue would be much appreciated!

Related

Export IPA error on Xcode 7 in El Capitan

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.

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.

What happen if a static library (.a) contains duplicated object files (.o)?

AFAIK, older version of Xcode failed to link a static library if it has been linked multiple times. I think there's a kind of duplicated object-file or symbol issue.
Recently, I realized Xcode5 is not reporting related error anymore on duplicated link of a static library. Here's my test.
I wrote 3 Objective-C classes are named as s1, s2, s3 in separated projects.
Each of them is compiled into s1.o, s2.o, s3.o,
and finally archived into s1.a, s2.a, s3.a.
s2 linked (merged) with s1, and s3 is linked (merged) with s2 and s1.
Finally I got these .a files.
Eonil$ ar -tv libs1.a
rw-r--r-- 501/20 64 Aug 3 18:38 2014 __.SYMDEF SORTED
rw-r--r-- 501/20 5528 Aug 3 18:38 2014 s1.o
Eonil$ ar -tv libs2.a
rw-r--r-- 501/20 120 Aug 3 18:38 2014 __.SYMDEF SORTED
rw-r--r-- 501/20 5872 Aug 3 18:38 2014 s2.o
rw-r--r-- 501/20 5528 Aug 3 18:38 2014 s1.o
Eonil$ ar -tv libs3.a
rw-r--r-- 501/20 224 Aug 3 18:38 2014 __.SYMDEF
rw-r--r-- 501/20 5872 Aug 3 18:38 2014 s3.o
rw-r--r-- 501/20 5528 Aug 3 18:38 2014 s1.o
rw-r--r-- 501/20 5872 Aug 3 18:38 2014 s2.o
rw-r--r-- 501/20 5528 Aug 3 18:38 2014 s1.o
Those same named .o files are all duplicated.
I wrote a p1 project which is a command line executable, and linked it with all the s1.a, s2.a, s3.a. I expected some duplication error, but it just built and working well!
What's happening in Xcode for these duplicated linking of static libraries?
Confirmed; the linker stops looking for symbols once it finds it in the first library.
If you use the -all_load option, however it will fail:
$ clang -all_load -o prog main.o -L. -lone -ltwo -lthree
duplicate symbol _func in:
./libone.a(file.o)
./libtwo.a(file.o)
duplicate symbol _func in:
./libone.a(file.o)
./libthree.a(file.o)
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This was tested using C, not that that matters:
$ cat main.c
extern void func();
int main(int argc, const char **argv)
{
func();
return 0;
}
$ cat file.c
#include <stdio.h>
void func()
{
printf("func()\n");
}

Leopard => Snow Leopard architecture woes with nokogiri / rails

I'm confused. It's a regular state of affairs for me but specifically in this case I felt I could reach out to fellow stackoverflowers (that is, stackoverflow-ers, not stackover-flowers).
uname -a
Darwin macbookpro 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386
set
bash-3.2$ set
...
HOSTTYPE=x86_64
...
MACHTYPE=x86_64-apple-darwin10.0
...
I'm having a nightmare rebuilding some native ruby gems and I'm wondering whether this is part of the problem -- part of this machine says its 64 bit but another part 32 ... as far as I can tell?
Under 'About this Mac' it says 'Intel Core 2 Duo' which Apple says is 64 bit. So why, after doing
sudo gem pristine --all
am I still getting this kind of error?
dlopen(/Applications/Rails/ruby/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle, 9): no suitable image found. Did find:
/Applications/Rails/ruby/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle: mach-o, but wrong architecture - /Applications/Rails/ruby/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle
Specifically I had removed nokogiri and reinstalled it. No errors in output.
bash-3.2$ sudo gem install nokogiri
Building native extensions. This could take a while...
Successfully installed nokogiri-1.4.2
1 gem installed
thanks for any thoughts!
UPDATE
I've found a useful post by Chris Noos on a similar problem. This is where I am:
cd /usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.4.2/
then made a file called wem_extconf.rb:
require 'mkmf'
find_library('xml2', 'xmlParseDoc')
dir_config('any-string-here', '/opt/local/include', '/opt/local/lib')
find_library('xml2', 'xmlParseDoc')
Running sudo web_extconf.rb produces
checking for xmlParseDoc() in -lxml2... no
checking for xmlParseDoc() in -lxml2... no
???? But hang on, it is there:
$ port installed | grep libxml2.*active
libxml2 #2.7.7_0+universal (active)
$ ls -l /opt/local/lib | grep libxml2
-rwxr-xr-x 2 root admin 2623276 31 May 20:09 libxml2.2.dylib
-rw-r--r-- 2 root admin 3643928 31 May 20:09 libxml2.a
lrwxr-xr-x 1 root admin 15 31 May 20:09 libxml2.dylib -> libxml2.2.dylib
-rwxr-xr-x 2 root admin 975 31 May 20:09 libxml2.la
And it does appear I have several copies of the thing -- but not sure which one port installed is using (I'm assuming given it's macports, it's /opt?)
$ ls -l /usr/lib | grep libxml2
lrwxr-xr-x 1 root wheel 15 23 May 16:07 libxml2.2.7.3.dylib -> libxml2.2.dylib
-rwxr-xr-x 1 root wheel 3758272 22 Sep 2009 libxml2.2.dylib
lrwxr-xr-x 1 root wheel 15 23 May 16:07 libxml2.dylib -> libxml2.2.dylib
$ ls -l /usr/local/lib | grep libxml2
-rwxr-xr-x 1 root admin 1456292 30 Oct 2009 libxml2.2.dylib
-rw-r--r-- 1 root admin 4812456 30 Oct 2009 libxml2.a
-rwxr-xr-x 1 root admin 1456292 30 Oct 2009 libxml2.dylib
-rwxr-xr-x 1 root admin 951 30 Oct 2009 libxml2.la
On Snow Leopard, gcc has a misleading behavior; even if you are running a i386 kernel, gcc will produce 64 bits binaries by default.
Have you looked at the GEM documentation to see how to specify the targeted architecture ?
Have you installed the XCode Development tools?

Resources