Closed Hocuri closed 6 years ago
When DuckDuckGo'ing for the core error ("mmap is not available with _FILE_OFFSET_BITS=64 when using GCC until android-21. Either raise your minSdkVersion, disable _FILE_OFFSET_BITS=64, or switch to Clang."), I got eg. this result - https://github.com/android-ndk/ndk/issues/332#issuecomment-344560630 - seems as if we have to fix sth. for the newer NDKs.
Maybe this is also the reasons why F-Droid makes problems these days.
I think that clang can be used like this:
diff --git a/MessengerProj/jni/Application.mk b/MessengerProj/jni/Application.mk
index 038832a..5f18821 100644
--- a/MessengerProj/jni/Application.mk
+++ b/MessengerProj/jni/Application.mk
@@ -1,4 +1,4 @@
APP_PLATFORM := android-14
APP_ABI := armeabi armeabi-v7a x86
-NDK_TOOLCHAIN_VERSION := 4.9
+NDK_TOOLCHAIN_VERSION := clang
APP_STL := gnustl_static
With clang, you have to use NULL instead of 0 if you mean a pointer: (Or would nullptr
be better?)
diff --git a/MessengerProj/jni/gifvideo.cpp b/MessengerProj/jni/gifvideo.cpp
index 3de0db8..1b341b2 100644
--- a/MessengerProj/jni/gifvideo.cpp
+++ b/MessengerProj/jni/gifvideo.cpp
@@ -160,7 +160,7 @@ jint Java_com_b44t_ui_Components_AnimatedFileDrawable_createDecoder(JNIEnv *env,
info->video_dec_ctx = info->video_stream->codec;
}
- if (info->video_stream <= 0) {
+ if (info->video_stream == NULL) {
LOGE("can't find video stream in the input, aborting %s", info->src);
delete info;
return 0;
(Am I right assuming that a pointer can't have a negative value?)
But there still is an error (although it appears way later):
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi/libmessenger.1.so] Error 1
I attached the full error log: error.txt
Update: The diffs can be seen here: https://github.com/deltachat/deltachat-android/compare/master...Hocceruser:master
Okay, while my normal development environment works, I can reproduce the problem with a fresh Android Studio install using the new NDK android-ndk-r16b-*-x86_64.zip - i assume, you use the same one?
As a workaround, you could use NDK android-ndk-r15c-*-x86_64.zip , however, of course, sooner or later we should fix the problem directly. I've added an appropriate hint in the readme.
PR to fix the issue are very welcome.
Regarding the F-Droid-Problem: F-Droid uses r15c, so this should not be a problem there.
seems as if we stuck in ndk r14b, see #220, one can fix this later, but for now, this seems to be out of scope.
Closed after README update 3ecb5a4: "dependecy on NDK 14b".
Delta Chat version
Newest GitHub version
Expected behavior
ndk-build to work :-)
Actual behavior
Naturally, when i build and launch Delta Chat anyway, it crashes ("Unfortunately, Delta Chat has stopped.").
Steps to reproduce the problem
Follow the "Install Development Environment" and then the "Build" instructions in the readme (Or did I miss something / do something wrong ?)