[mythtv] Building for Android, mariadb issue

David Engel david at istwok.net
Tue Aug 7 01:18:15 UTC 2018


On Sun, Aug 05, 2018 at 05:44:01PM -0500, David Engel wrote:
> On Sun, Aug 05, 2018 at 02:49:41PM -0600, John P Poet wrote:
> > > > > which ndk?
> > > > > I have validated 13b
> > > > > 14 onwards has missing headers.
> > > > > The other thing to check is your default environment. printenv.
> > > > > Not sure otherwise.
> > > >
> > > > I vaguely remember some nl_langinfo problem, but not the solution.
> > > > I'm searching my old emails.  I'll reply if find something.
> > >
> > > My search didn't yield anything.  As Mark said, make sure you're using
> > > the currently, preferred NDK.  Also, make sure you run "./makelibs.sh
> > > all" instead of simply "./makelibs.sh".  I know that tripped me up at
> > > first.
> > >
> > 
> > I downloaded and linked r13b.  That seems to mess up the toolchain.  Even
> > after re-running maketoolchain.sh, I got:
> > * /home/john/android/android-ndk/my-android-toolchain64/bin/aarch64-linux-android-gcc:
> > Command not found*
> 
> I'll try to do a full install and build from scratch, but it won't be
> until at least tomorrow.

John,

I did a full install of Android Studio/SDK/NDK and build of libs and
mythfrontend today.  I updated the Readme.md to specify NDK r13b
instead of r15c and removed a couple of very minor things that weren't
necessary.  I also fixed a bug in makelibs.sh related to the recent
library changes.  It all built and runs fine.

I think the main problem you're having is trying to use the NDK
installed by Android Studio.  Be sure to install the r13b (or r15c if
you really want to) version manually as directed and I think you
should be fine.

We should eventually try to get builds to use the NDK installed by
Android Studio, but that's a job for another day.

David

> > So, I deceded to start from with a brand new VM.  Since the instructions
> > say to use r15c, I took one more stab at it, this time replacing the ndk
> > that android-studio downloads.  android-studio installs ndk 17.1.482850 in
> > ~/Android/Sdk/ndk-bundle.  I moved that aside. and put android-ndk-r15c in
> > its place:
> 
> The NDKs that we have been using are definitely the ones from zip
> files that we downloaded and install manually.  Specifically the
> following.
> 
> 771bb5121a78122620723af92fbfbb18  android-ndk-r13b-linux-x86_64.zip
> 9a52de7648f86468ea3ca0f6f08e6c57  android-ndk-r15c-linux-x86_64.zip
> 
> It is the SDK that is installed by Android Studio.
> 
> > *$ ls -al ~/Android/Sdk*
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > *total 60drwxrwxr-x. 14 john john 4096 Aug  3 20:41 .drwxrwxr-x.  3 john
> > john 4096 Aug  3 20:29 ..drwxr-xr-x. 15 john john 4096 Aug  3 20:44
> > android-ndk-r15cdrwxrwxr-x.  3 john john 4096 Aug  3 20:33
> > build-toolsdrwxrwxr-x.  3 john john 4096 Aug  3 20:35 cmakedrwxrwxr-x.  7
> > john john 4096 Aug  3 20:32 emulatordrwxrwxr-x.  4 john john 4096 Aug  3
> > 20:32 extras-rw-rw-r--.  1 john john   16 Aug  3 20:43
> > .knownPackagesdrwxrwxr-x.  2 john john 4096 Aug  3 20:35
> > licenseslrwxrwxrwx.  1 john john   16 Aug  3 20:41 ndk-bundle ->
> > android-ndk-r15cdrwxrwxr-x. 13 john john 4096 Aug  3 20:38
> > ndk-bundle-bakdrwxrwxr-x.  3 john john 4096 Aug  3 20:31
> > patcherdrwxrwxr-x.  5 john john 4096 Aug  3 20:35 platformsdrwxrwxr-x.  5
> > john john 4096 Aug  3 20:29 platform-toolsdrwxrwxr-x.  4 john john 4096
> > Aug  3 20:35 sourcesdrwxrwxr-x.  6 john john 4096 Aug  3 20:31 tools*
> > 
> > The instructions also expect the android-sdk to be in ~/android, so I setup
> > a soft link from the default location of ~/Android/Sdk to
> > ~/android/android-sdk-linux. I end up with:
> 
> I don't remember how my SDK got to ~/android/android-sdk-linux.  I
> think it might have been an option when it was first installed by
> Android Studio.  However it got there, we are not directly referencing
> any ndk-bundle within it.  As noted above, we are using the separately
> downloaded and installed NDKs.
> 
> > *$ ls -al ~/android*
> > 
> > 
> > 
> > 
> > *android-ndk -> android-sdk-linux/ndk-bundleandroid-sdk-linux ->
> > ../Android/Sdkandroid-studiomaketoolchain.shsetenv.sh*
> > 
> > When I go to build, I get lots of warnings:
> > *BFD: libncurses.so.5: cannot open shared object file: No such file or
> > directory*
> > but that does not seem to affect the build.
> 
> I ran into this after apt decided I no longer needed the old, ncurses
> libraries.  Reinstalling the old libraries solved that for me.
> 
> David
> 
> > It still fails on mariadb, but this time the error is different:
> > /home/john/workdir/packaging/android/libs64/mariadb-connector-c-2.1.0-src/libmariadb/my_charset.c:55:19:
> > fatal error: iconv.h: No such file or directory
> > 
> > So, I finally relented and replaced r15c with r13b.  Like with r15c, I
> > installed into ~/Android/Sdk and adjusted the softlinks.  After running
> > maketoolchain.sh I tried to build the libs, and once again got:
> > */home/john/android/android-ndk/my-android-toolchain64/bin/aarch64-linux-android-gcc:
> > Command not found*
> > 
> > So, from scratch again...
> > 
> > This time, I moved ~/Android/Sdk/ndk-bundle out of the way, and replaced it
> > with android-ndk-r13b.  Then I soft linked that to ~/android/android-ndk .
> > Once again, I have ~/Android/Sdk soft linked to
> > ~/android/android-sdk-linux.  And... it still fails to build:
> > 
> > 
> > 
> > 
> > *make[1]: Entering directory
> > '/home/john/workdir/packaging/android/libs64/openssl-1.0.2l/crypto'/usr/bin/perl
> > ../util/mkbuildinf.pl <http://mkbuildinf.pl>
> > "/home/john/android/android-ndk/my-android-toolchain64/bin/aarch64-linux-android-gcc
> > -I. -I.. -I../include  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN
> > -DHAVE_DLFCN_H -D__ANDROID_API__=21 -mandroid -I/include -B/lib -O3
> > -fomit-frame-pointer -Wall" "android"
> > >buildinf.h/home/john/android/android-ndk/my-android-toolchain64/bin/aarch64-linux-android-gcc
> > -I. -I.. -I../include  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN
> > -DHAVE_DLFCN_H -D__ANDROID_API__=21 -mandroid -I/include -B/lib -O3
> > -fomit-frame-pointer -Wall   -c -o cryptlib.o cryptlib.cmake[1]:
> > /home/john/android/android-ndk/my-android-toolchain64/bin/aarch64-linux-android-gcc:
> > Command not found*
> > 
> > With r13b, I seem to always end up with a path issue.  It will build some
> > of the libs, but eventually fails because it cannot
> > findaarch64-linux-android-gcc.  Honestly, it makes it further with r15c.
> > 
> > I am obviously making bad guesses on what to do regarding difference with
> > the latest package of android-studio, compared to what the instructions
> > expect.  After hacking on this for over four hours, I am fried.
> > 
> > John
> 
> > _______________________________________________
> > mythtv-dev mailing list
> > mythtv-dev at mythtv.org
> > http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> > http://wiki.mythtv.org/Mailing_List_etiquette
> > MythTV Forums: https://forum.mythtv.org
> 
> 
> -- 
> David Engel
> david at istwok.net

-- 
David Engel
david at istwok.net


More information about the mythtv-dev mailing list