sqlcipher / android-database-sqlcipher

Android SQLite API based on SQLCipher
https://www.zetetic.net/sqlcipher/sqlcipher-for-android/
Other
2.73k stars 564 forks source link

Build failure for v4.3.0 #503

Closed akallabeth closed 3 years ago

akallabeth commented 4 years ago

Expected Behavior

Build succeedes

Actual Behavior

Build aborts at ndk-build step in Task :android-database-sqlcipher:buildNative FAILED

Steps to Reproduce

  1. Fresh installed android SDK
  2. Using side-by-side NDK (version does not matter, tried from 16 up to 21)
  3. Fresh clone of this repository, check out tag v4.3.0 (same is true for master)
  4. make init && make build-debug
    1. See OpenSSL being build
    2. See build abort at sqlcipher step
developernotes commented 4 years ago

Hi @akallabeth

Build aborts at ndk-build step in Task :android-database-sqlcipher:buildNative FAILED See build abort at sqlcipher step

What are the details provided in the error message specifically?

Using side-by-side NDK (version does not matter, tried from 16 up to 21)

You will need to use NDK version r20.

akallabeth commented 4 years ago
developernotes commented 4 years ago

Hi @akallabeth

Is that 20.0.5594570 or 20.1.5948944 from sdkmanager? (Sorry, always get confused by google versioning) or are there actual differences between sdkmanager and direct downloads?

I believe you want 20b, which maps to "20.1.5948944"

how do I get the output of native build tools in a gradle build? (gradle is very verbose but tends to lack the information actually relevant)

Try running the following command to get further details. I agree Gradle can be verbose, but we need to start somewhere to further narrow down the cause of your build error. Is there a reason you need to build the library from source?

./gradlew android-database-sqlcipher:buildNative --debug
akallabeth commented 4 years ago

log.zip

attached the output, but it only tells ndk-build failed :/

akallabeth commented 4 years ago

@developernotes and yes, we try to minimize app footprint and our native code already uses openssl, so I need a version linked against that one.

developernotes commented 4 years ago

Hi @akallabeth

Can you check to see if ndk-build is available on your PATH (i.e., execute which ndk-build)?

akallabeth commented 4 years ago

@developernotes yes, added it manually. Can run it in bash, path in ndk dir used (I think I had the wrong one when I created the log). same result.

developernotes commented 4 years ago

Hi @akallabeth

What happens when you run make build-openssl?

akallabeth commented 4 years ago

@developernotes that one is building openssl, no issues.

developernotes commented 4 years ago

Hi @akallabeth

After attempting a build of ./gradlew android-database-sqlcipher:buildNative, navigate into the SQLCipher directory:

cd android-database-sqlcipher/src/main/external/sqlcipher/

Do you see a config.log file present? If so, what is contained in the file? Do you see any errors?

akallabeth commented 4 years ago

config.zip

some conftest errors nothing I´d call suspicious, but attaching the file for review.

developernotes commented 4 years ago

Hi @akallabeth

Do you have build-essential installed? Also, it appears you are also missing Tcl.

akallabeth commented 4 years ago

@developernotes wait, what? This is a cross compile, build-essential are host compiler tools. Anyway, installed, compiling C related stuff every day. The tcl part I can check tomorrow (late here)

Also tried on another machine (fedora 31 host), sadly same result.

developernotes commented 4 years ago

Hi @akallabeth

wait, what? This is a cross compile, build-essential are host compiler tools.

Correct, however a part of the build process is to prepare an amalgamation of SQLCipher which is compiled with the JNI layer.

akallabeth commented 4 years ago

Ok, ran the ndk-build step manually with the environment and workingdir copied from the log. Get these lines:

make: Entering directory '/home/nin/src/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp'
/home/nin/Android/Sdk/ndk/21.0.6113669/build/gmsl/__gmsl:512: *** non-numeric second argument to 'wordlist' function: ''.  Stop.
make: Leaving directory '/home/nin/src/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp'

EDIT: Just seen I posted from the wrong terminal (NDK 21), also ran with NDK r20b, same result

developernotes commented 4 years ago

Hi @akallabeth

Just to rule out a difference in what specific Android NDK was installed via sdkmanager (I don't use that directly), would you try this archive provided by Google? It matches the exact NDK version in source.properties that I am using. Thanks!

akallabeth commented 4 years ago

@developernotes same same :/

stale[bot] commented 4 years ago

Hello, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug", "enhancement", or "security" and I will leave it open. Thank you for your contributions.

akallabeth commented 4 years ago

still not able to build with either 4.3.0 tag or 7d86f6bd702da7c4cb66e77b4543822fe89fe87a

developernotes commented 4 years ago

Hi @akallabeth

same same :/

Would you mind clarifying what specific command and error message you received when running the command using the linked NDK?

akallabeth commented 4 years ago

@developernotes they are exactly the same, (maybe the line is different). (the non-numeric message from above)

akallabeth commented 4 years ago

@developernotes I will retry this evening when I have time.

stale[bot] commented 4 years ago

Hello, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug", "enhancement", or "security" and I will leave it open. Thank you for your contributions.

akallabeth commented 4 years ago

Ok, sorry, did forget about this. Tested this again (also with v4.4.0) on ubuntu 18.04 and 20.04:

  1. Installed linked NDK
  2. Installed command line sdktools, dependencies installed by gradle
  3. Installed tcl and build-essentials on host
  4. Set up ANDROID_NDK_ROOT, ANDROID_NDK_HOME and ANDROID_HOME, ANDROID_SDK_ROOT (just to be sure we cover the most common variants out there)
  5. Ran make init and make build-debug
  6. Both fail with the same error (attached the output of the 18.04 build) log.txt.zip
developernotes commented 4 years ago

Hi @akallabeth

Would you rerun your android-database-sqlcipher:buildAmalgamation task with the --debug flag and provide the build output for review?

akallabeth commented 4 years ago

log.txt.zip

ran

  1. ./gradlew buildAmalgamation --debug 2>&1 |tee log.txt
  2. ./gradlew buildNative --debug 2>&1 |tee native-log.txt
developernotes commented 4 years ago

Hi @akallabeth

Is it possible you sent an old log.txt.zip file? The output in the linked log file doesn't appear to have the usually verbose debug output.

akallabeth commented 4 years ago

@developernotes ok, that is embarrassing, yes, you´re right, uploaded the wrong zip :/ back on monday, currently only limited access to the test machine.

akallabeth commented 4 years ago

Ran the test again, this time the correct zip.

  1. git clean -xdf
  2. ./gradlew buildAmalgamation --debug 2>&1 |tee log.txt
  3. ./gradlew buildNative --debug 2>&1 |tee native-log.txt

log.txt.zip

stale[bot] commented 3 years ago

Hello, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug", "enhancement", or "security" and I will leave it open. Thank you for your contributions.

stale[bot] commented 3 years ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to reopen with up-to-date information.

developernotes commented 3 years ago

Hi @akallabeth

My apologizes for the delay in response. Reviewing your log, it appears this command fails. Would you try running it directly and let us know the output?

ndk-build V=1 NDK_DEBUG=0 --environment-overrides NDK_LIBS_OUT=/home/nin/src/android-database-sqlcipher/android-database-sqlcipher/src/main/libs32 -C /home/nin/src/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp NDK_APPLICATION_MK=/home/nin/src/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp/Application32.mk
akallabeth commented 3 years ago

@developernotes sorry, was on vacation, will try as soon as possible

stale[bot] commented 3 years ago

Hello, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug", "enhancement", or "security" and I will leave it open. Thank you for your contributions.

akallabeth commented 3 years ago

Sorry, did forget.

Here:

ndk-build V=1 NDK_DEBUG=0 --environment-overrides NDK_LIBS_OUT=/home/nin/src/android-database-sqlcipher/android-database-sqlcipher/src/main/libs32 -C /home/nin/src/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp NDK_APPLICATION_MK=/home/nin/src/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp/Application32.mk
make: Entering directory '/home/nin/src/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp'
/home/nin/Android/Sdk/ndk/21.3.6528147/build/gmsl/__gmsl:512: *** non-numeric second argument to 'wordlist' function: ''.  Stop.
make: Leaving directory '/home/nin/src/android-database-sqlcipher/android-database-sqlcipher/src/main/cpp'

Same for other NDK versions.

developernotes commented 3 years ago

Hi @akallabeth

What Linux distribution and version are you running this build on?

akallabeth commented 3 years ago

@developernotes ubuntu 20.04

stale[bot] commented 3 years ago

Hello, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug", "enhancement", or "security" and I will leave it open. Thank you for your contributions.

developernotes commented 3 years ago

Hi @akallabeth

I'm sorry for the delay, I've made a few changes to the build process necessary for building on Ubuntu 20.04. I am now able to successfully but on Ubuntu 20.04. Would you mind pulling the latest changes, then run the following and let us know your results?

make distclean
make build-debug

Thanks!

akallabeth commented 3 years ago

@developernotes thank you, commit 41bcfa9d4a05982c4e0c0076f90b0cb5ad56d1e0 does build, even with the most recent NDK

developernotes commented 3 years ago

Hi @akallabeth

Excellent, that is great news, thank you for confirming on your end. I will close this issue now, thank you again for your report!