question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build error on Mac: no archive symbol table (run ranlib)

See original GitHub issue

I’m trying to package a Kivy hello world app on Mac., and it’s failing during the NDK build indicating that several SDL2 libraries are invalid: no archive symbol table (run ranlib).

I installed python-for-android 0.4 via pip. I’m on Mac OS 10.11.6, using NDK r11c with GCC 4.9. Here’s the command I’m running:

p4a apk --private . --package=org.example.HelloKivy --name "Hello Kivy" --version 0.1 --bootstrap=sdl2 --requirements=python2,kivy --sdk_dir $ANDROID_HOME --ndk_dir $ANDROID_NDK_HOME --android_api 16 --ndk_ver "r11c" --debug

And the full errors:

/Users/atwyman/Library/Android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: SDL2_ttf: no archive symbol table (run ranlib)
/Users/atwyman/Library/Android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: SDL2_image: no archive symbol table (run ranlib)
/Users/atwyman/Library/Android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: SDL2_mixer: no archive symbol table (run ranlib)
/Users/atwyman/Library/Android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: SDL2: no archive symbol table (run ranlib)
collect2: error: ld returned 1 exit status

Googling similar issues suggested this might be a case of the local version of ar being used rather than the NDK version. I tried overriding via environment variables in various combinations, working up to the full set listed here: http://stackoverflow.com/questions/13751560/android-ndk-no-archive-symbol-table

Setting those variables for the a full clean package breaks the local parts of the Python build. Setting them on a retry (which skips the already-done steps) or in the ndk-build script results in the same error.

Any clue what’s going on? Am I wrong to assume that python-for-android is expected to work on Mac vs. Linux?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gobftald1commented, Jul 19, 2017

the problem is in pythonforandroid/build.py:695

the code fragment beggining there makes a unique_args list removing redundant “-L directories” form the “biglinking” command of libpymodules.so

but it starts at the end of the original args list and removes the “-L …/.python-for-android/build/bootstrap_builds/sdl2-python2/obj/local/armeabi-v7a” directory – where the libSDL2xxx.so shared object libraries were placed – from the beginning of the list of searched libraries

so replace the

while args: a = args.pop() if a in (‘-L’, ): continue if a not in unique_args: unique_args.insert(0, a)

code fragment with the simple

for a in args: if a not in unique_args: unique_args.append(a)

code and the linking phase then the whole building procedure will be OK

0reactions
inclementcommented, Jan 30, 2019

Closing as this code seems to have been replaced.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android NDK: no archive symbol table (run ranlib)
How to run ranlib on an archive built through Android.mk? no archive symbol table (run ranlib) while building libcryptopp.a through ndk-build.
Read more >
no archive symbol table (run ranlib) while building libcryptopp ...
Coding example for the question no archive symbol table (run ranlib) while building libcryptopp.a through ndk-build-C++.
Read more >
error: lua: no archive symbol table (run ranlib) (#97) · Issues
i'm compile android platform on macosx VLC source found Configuring ABI: armeabi-v7a API: android-9 SYSROOT: ...
Read more >
No Archive Symbol Table (Run Ranlib) While Building ...
This program can be used to create static libraries (which are actually archive files), modify It is not a goal to preserve complete...
Read more >
Developers - Build error on Mac: no archive symbol table (run ranlib) -
Build error on Mac : no archive symbol table (run ranlib). Kivy. 14 February 2017 Posted by artwyman. I'm trying to package a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found