Non-public API usage - The app references non-public symbols: _ffi_*
See original GitHub issueVersions
- Python : 3.8
- MacOS version : 10.15.7
- XCode Version : 12.0.1
- Cython version : 0.29.17
Describe the bug
My app runs fine on the simulators and on a device, but when I archive the project and distribute it to App Store Connect I receive an email from Apple saying that my app has been rejected. The email reads:
ITMS-90338: Non-public API usage - The app references non-public symbols in ccc-graphs-12: _ffi_call, _ffi_closure_alloc, _ffi_closure_free, _ffi_prep_cif, _ffi_prep_closure_loc, _ffi_type_double, _ffi_type_float, _ffi_type_pointer, _ffi_type_sint16, _ffi_type_sint32, _ffi_type_sint64, _ffi_type_sint8, _ffi_type_uint16, _ffi_type_uint32, _ffi_type_uint64, _ffi_type_uint8, _ffi_type_void. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/
To Reproduce
- Install the toolchain and create an Xcode project.
- In the Xcode project: Build Phases --> Run Script add “-O --no-perms”
- Resolve warnings (use Xcode recommended updates). This includes changing the architecture to “Standard architecture” and migrating deprecated languages – NOTE. This step is not necessary! The exact same issue is reproduced without this step.
- Add an icon image set to app.
- In Signings & Capabilities configure the Team and Bundle Identifier.
- In Sources --> main.m change
#include "Python.h"
to an absolute path, i.e."/path/to/kivy-ios/dist/root/python3/include/python3.8/Python.h"
as is explained here. - In the
<yourapp>-Info.plist
file specify why you need the camera or that you don’t use it, as is explained here. - In General select “Requires full screen”
At this point, the project should be ready to upload. Build for “Any iOS Device” and click on Products --> Archive. After going through all the steps in the archive window, I am shown a message saying that the upload has been successful. This is shortly followed by the aforementioned rejection email.
Logs
No logs provided. However, the following may be of use:
Running toolchain status
returns:
audiostream - Not built
click - Not built
curly - Not built
cymunk - Not built
distribute - Not built
ffmpeg - Not built
ffpyplayer - Not built
flask - Not built
freetype - Build OK (built at 2020-12-09 20:02:24.391901)
host_setuptools - Not built
host_setuptools3 - Build OK (built at 2020-12-09 20:15:39.468316)
hostlibffi - Build OK (built at 2020-12-09 20:02:48.271488)
hostopenssl - Build OK (built at 2020-12-09 20:04:16.254736)
hostpython3 - Build OK (built at 2020-12-09 20:13:40.614943)
ios - Build OK (built at 2020-12-09 20:22:42.687770)
itsdangerous - Not built
jinja2 - Not built
kivent_core - Not built
kivy - Build OK (built at 2020-12-09 20:29:01.150111)
libcurl - Not built
libffi - Build OK (built at 2020-12-09 20:06:13.337783)
libjpeg - Not built
libpng - Not built
libzbar - Not built
markupsafe - Not built
netifaces - Not built
numpy - Not built
openssl - Build OK (built at 2020-12-09 20:08:59.288718)
photolibrary - Not built
pil - Not built
pillow - Not built
pkgresources - Not built
plyer - Not built
pycrypto - Not built
pykka - Not built
pyobjus - Build OK (built at 2020-12-09 20:23:58.339146)
python3 - Build OK (built at 2020-12-09 20:22:21.701912)
pyyaml - Not built
sdl2 - Build OK (built at 2020-12-09 20:10:14.409268)
sdl2_image - Build OK (built at 2020-12-09 20:14:17.752407)
sdl2_mixer - Build OK (built at 2020-12-09 20:15:23.982876)
sdl2_ttf - Build OK (built at 2020-12-09 20:15:35.183602)
werkzeug - Not built
zbarlight - Not built
Additionally, following the steps listed here, I navigated to the archive I uploaded to Apple and I ran the following commands in the terminal:
nm <App Name> | grep ffi_call
nm <App Name> | grep ffi_closure_alloc
nm <App Name> | grep ffi_closure_free
etc.
The only only unique output of the above commands was that for nm <App Name> | grep ffi_call
which returned:
0000000100d1a2ea s ___pyx_k_pointer_before_ffi_call
U _ffi_call
The remaining command all returned U _ffi_closure_alloc
etc.
Additional information
You can find Apple’s private API here.
Things I have tried in vain:
- Build an Xcode project without
libffi
andhostlibffi
. This just causes the app to crash. - Unlinking
ffilib.a
from the project. This is interesting, more on this below. - Searching for
_ffi_
in the kivy-ios folder and deleting all the files that came up. This did nothing. - Wrote a program that systematically changes
_ffi_call
to__ffi_call
, etc. in all the kivy-ios files. This didn’t make a difference. To be he honest, I don’t know why I ever thought this would work.
Unlinking ffilib.a
from the project
Now doing so causes the build to fail on the simulators, but the errors I receive are:
This makes me think that the error lies with the libffi.a
static library, though I can’t be too sure.
Anyway, thanks for taking the time out to read this. I am at the end of my wits, so any insight into the problem or suggestion - seriously anything at all - is hugely appreciated.
Issue Analytics
- State:
- Created 3 years ago
- Comments:40 (10 by maintainers)
Top GitHub Comments
The process is pretty the same as building
kivy-ios
on top of master.Given that you have successfully cloned the
kivy-ios
repo viagit clone https://github.com/kivy/kivy-ios.git
, inside thekivy-ios
folder you have to launch the two following commands:git fetch origin pull/582/head:test-pr-582
git checkout test-pr-582
In order to be sure that you did it right, a
git log
should show “Fixes header and library search paths on Release” as the topmost commit.If it’s ok, then you can start by creating the venv and continue to follow the standard procedure.
As mentioned here, you can avoid doing the following steps thanks to this PR:
At the end of the test, you can revert to the repo
master
by doinggit checkout master
inside thekivy-ios
folder.Same here. I am a newbie.
On Thu, 31 Dec 2020 12:09 pm Mirko, notifications@github.com wrote: