I'm trying to build OsmAnd, including the latest core. I've followed these instructions so far, and they appear to be working. However, this results in a build of "core-legacy", which i notice has completely different code to the master branch of OsmAnd-core. However, core-legacy also outputs "Native ok" followed by some rendering information, which is the behaviour shown by the lastest install (2.4.6) from f-droid. I.e. the latest release is using core-legacy.
Is the master branch a new core that isn't stable enough for release yet (i notice the github has quite low activity)? To be able to compile with the master branch core, do i simply follow the build instructions in the OsmAnd-core readme, then cd to android/OsmAnd and run "gradle assembleDebug"? (Forgive me for asking without trying, but compilation takes all day and i'm still building the one with core-legacy!)
--
You received this message because you are subscribed to the Google Groups "Osmand" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.
Still working on compiling the master core!
I'm not entirely sure. You need to have the android sdk and ndk sources already installed. It appears to download it's own version of qt. So i think the answer is a bit of both.Still working on compiling the master core!
mkdir ~/osmand
cd ~/osmand
git clone https://github.com/osmandapp/OsmAnd-core -b legacy_core core-legacy
git clone https://github.com/osmandapp/Osmand Osmand
git clone https://github.com/osmandapp/OsmAnd-resources resources
# help module is optional
git clone https://github.com/osmandapp/osmandapp.github.io help
export ANDROID_SDK=/opt/android-sdk-update-manager
export ANDROID_NDK=/opt/android-ndk/
cd Osmand
./gradlew --refresh-dependencies assembleFullLegacyFatDebug
[100%] Built target OsmAndCore_static
Processing types...
C++ analysis...
Processing nested classes...
Generating wrappers...
[100%] Built target OsmAndCore_swig_java
Scanning dependencies of target OsmAndCoreWithJNI
[100%] Building CXX object core/wrappers/java/CMakeFiles/OsmAndCoreWithJNI.dir/gen/cpp/swig.cpp.o
[100%] Linking CXX shared library /home/karol/Projekty/osmand/binaries/android/gcc-armeabi-v7a/Debug/libOsmAndCoreWithJNI.so
/opt/android-ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lgnustl_shared
/home/karol/Projekty/osmand/core/src/IFontFinder.cpp:9: error: undefined reference to 'std::ios_base::Init::~Init()'
/home/karol/Projekty/osmand/binaries/android/gcc-armeabi-v7a/Debug/libOsmAndCore_static.a(IFontFinder.cpp.o):IFontFinder.cpp:typeinfo for OsmAnd::IFontFinder: error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/opt/android-ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
/home/karol/Projekty/osmand/core/src/ILogSink.cpp:9: error: undefined reference to 'std::ios_base::Init::~Init()'
/home/karol/Projekty/osmand/binaries/android/gcc-armeabi-v7a/Debug/libOsmAndCore_static.a(ILogSink.cpp.o):ILogSink.cpp:typeinfo for OsmAnd::ILogSink: error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/opt/android-ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function
/home/karol/Projekty/osmand/core/src/IQueryController.cpp:9: error: undefined reference to 'std::ios_base::Init::~Init()'
### Here goes about hundreds of similar lines ###
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:2814: error: undefined reference to 'std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_trai ts<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char)'
libs/thread/src/pthread/thread.cpp:601: error: undefined reference to 'std::locale::locale()'
libs/thread/src/pthread/thread.cpp:602: error: undefined reference to 'std::locale::locale()'
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:249: error: undefined reference to 'std::string::_Rep::_M_destroy(std::allocator<char> const&)'
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/locale_facets.h:869: error: undefined reference to 'std::ctype<char>::_M_widen_init() const'
libs/thread/src/pthread/thread.cpp:617: error: undefined reference to 'std::basic_ifstream<char, std::char_traits<char> >::~basic_ifstream()'
libs/thread/src/pthread/thread.cpp:617: error: undefined reference to 'std::basic_ifstream<char, std::char_traits<char> >::~basic_ifstream()'
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_ios.h:49: error: undefined reference to 'std::__throw_bad_cast()'
/home/karol/Projekty/osmand/core/externals/boost/upstream.patched.android.gcc-armeabi-v7a.static/stage/lib/libboost_thread-gcc-mt-1_56.a(thread.o):thread.cpp:typeinfo for boost::bad_lexical_cast: error: undefined reference to 'typeinfo for std::bad_cast'
collect2: error: ld returned 1 exit status
make[3]: *** [core/wrappers/java/CMakeFiles/OsmAndCoreWithJNI.dir/build.make:124: /home/karol/Projekty/osmand/binaries/android/gcc-armeabi-v7a/Debug/libOsmAndCoreWithJNI.so] Błąd 1
make[2]: *** [CMakeFiles/Makefile2:1099: core/wrappers/java/CMakeFiles/OsmAndCoreWithJNI.dir/all] Błąd 2
make[1]: *** [CMakeFiles/Makefile2:1111: core/wrappers/java/CMakeFiles/OsmAndCoreWithJNI.dir/rule] Błąd 2
make: *** [Makefile:352: OsmAndCoreWithJNI] Błąd 2
:OsmAndCore_androidNative:buildOsmAndCore FAILED
:OsmAndCore_androidNative:buildOsmAndCore (Thread[main,5,main]) completed. Took 3 mins 31.36 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':OsmAndCore_androidNative:buildOsmAndCore'.
> Process 'command 'sh'' finished with non-zero exit value 2
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Once this succeeded, and i'd built the new armv7 core, i was able to use it by changing to android/OsmAnd and running
gradle assembleFreeQtcoreArmv7Debug
Next step will be, how to build OsmAnd which includes this new core...
./gradlew --daemon assembleFullQtcoreArmv7Debug
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Validating translations
Incremental java compilation is an incubating feature.
:OsmAnd:buildOsmAndCore
BUILD_ALL set to true
OsmAnd root: jni/../../..
OsmAnd makefiles: jni/../../../core-legacy/targets/android/expat/Android.mk jni/../../../core-legacy/targets/android/freetype/Android.mk jni/../../../core-legacy/targets/android/giflib/Android.mk jni/../../../core-legacy/targets/android/jpeg/Android.mk jni/../../../core-legacy/targets/android/libpng/Android.mk jni/../../../core-legacy/targets/android/OsmAndCore/Android.mk jni/../../../core-legacy/targets/android/protobuf/Android.mk jni/../../../core-legacy/targets/android/skia/Android.mk
Android NDK: WARNING:jni/../../../core-legacy/targets/android/skia/Android.mk:osmand_skia: LOCAL_LDLIBS is always ignored for static libraries
OsmAnd root: jni/../../..
task buildOsmAndCore(type: Exec) {
description "Build Legacy OsmAndCore"
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine "bash", file("./old-ndk-build.sh").getAbsolutePath()
} else {
commandLine "cmd", "/c", "echo", "Not supported"
}
}
$ ./gradlew --daemon assembleFullQtcoreArmv7Debug
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Validating translations
Incremental java compilation is an incubating feature.
:OsmAnd:buildOsmAndCore
/home/karol/Projekty/osmand/Osmand/OsmAnd/ndk-build.sh: linia 31: /home/karol/Projekty/osmand/Osmand/OsmAnd/../../core/externals/configure.sh: Nie ma takiego pliku ani katalogu
/home/karol/Projekty/osmand/Osmand/OsmAnd/ndk-build.sh: linia 32: /home/karol/Projekty/osmand/Osmand/OsmAnd/../../core/externals/build.sh: Nie ma takiego pliku ani katalogu
/home/karol/Projekty/osmand/Osmand/OsmAnd/ndk-build.sh: linia 33: /home/karol/Projekty/osmand/Osmand/OsmAnd/../OsmAnd-java/generate-swig.sh: Nie ma takiego pliku ani katalogu
OsmAnd root: jni/../../..
OsmAnd makefiles:
/opt/android-ndk/build/core/build-all.mk:89: Android NDK: WARNING: There are no modules to build in this project!
:OsmAnd:cleanupDuplicatesInCore
:OsmAnd:collectFonts UP-TO-DATE
:OsmAnd:collectHelpContentsAssets UP-TO-DATE
I'm pretty sure it isn't using new core because in first lines of compilation log I can see core-legacy path :-
repositories {
flatDir{
dirs '../../core/wrappers/android/build/intermediates/exploded-aar/',
'../../core/wrappers/android/',
'../../core/wrappers/android/NativeCore/build/outputs/aar/',
'../../core/wrappers/android/build/outputs/aar',
'../../core/wrappers/android/NativeCoreRelease/build/outputs/aar',
'../../core/wrappers/android/NativeCoreDebug/build/outputs/aar'
}
ivy {
name = "OsmAndBinariesIvy"
url = "http://builder.osmand.net"
layout "pattern", {
artifact "ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
}
}
// mavenCentral()
}
dependencies {
compile project(path: ':OsmAnd-java', configuration: 'android')
// compile project(':eclipse-compile:design')
// compile project(':eclipse-compile:cardview')
// compile project(':eclipse-compile:gridlayout')
compile 'com.android.support:gridlayout-v7:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile fileTree(include: ['*.jar'], exclude: ['QtAndroid-bundled.jar', 'QtAndroidAccessibility-bundled.jar', 'OsmAndCore_android.jar', 'OsmAndCore_wrapper.jar', 'android-support-multidex.jar'], dir: 'libs')
legacyCompile "net.osmand:OsmAndCore_android-debug@aar"
qtcoredebugCompile "net.osmand:OsmAndCore_androidNativeDebug-debug@aar"
qtcoredebugCompile "net.osmand:OsmAndCore_android-debug@aar"
qtcoreCompile "net.osmand:OsmAndCore_androidNativeRelease-release@aar"
qtcoreCompile "net.osmand:OsmAndCore_android-release@aar"
}
repositories {
flatDir {
dirs '../../core/wrappers/android/NativeCoreDebug/build/outputs/aar',
'../../core/wrappers/android/build/outputs/aar'
}
ivy {
name = "OsmAndBinariesIvy"
url = "http://builder.osmand.net"
layout "pattern", {
artifact "ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
}
}
// mavenCentral()
}
dependencies {
compile project(path: ':OsmAnd-java', configuration: 'android')
// compile project(':eclipse-compile:design')
// compile project(':eclipse-compile:cardview')
// compile project(':eclipse-compile:gridlayout')
compile 'com.android.support:gridlayout-v7:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile fileTree(include: ['*.jar'], exclude: ['QtAndroid-bundled.jar', 'QtAndroidAccessibility-bundled.jar', 'OsmAndCore_android.jar', 'OsmAndCore_wrapper.jar', 'and
roid-support-multidex.jar'], dir: 'libs')
legacyCompile "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@jar"
qtcoredebugCompile compile(name: "OsmAndCore_androidNativeDebug-debug", ext: "aar")
qtcoredebugCompile compile(name: "OsmAndCore_android-debug", ext: "aar")
qtcoreCompile compile(name: "OsmAndCore_androidNativeDebug-debug", ext: "aar")
qtcoreCompile compile(name: "OsmAndCore_android-debug", ext: "aar")
}