Status of Osmand Core

626 views
Skip to first unread message

matt...@googlemail.com

unread,
Sep 18, 2016, 2:10:07 PM9/18/16
to Osmand
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!)

Harry van der Wolf

unread,
Sep 19, 2016, 5:04:08 AM9/19/16
to osmand
2016-09-18 20:10 GMT+02:00 matth1982 via Osmand <osm...@googlegroups.com>:
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.

matt...@googlemail.com

unread,
Sep 19, 2016, 6:25:10 AM9/19/16
to Osmand

Thanks for this.

However, this still leaves me confused about OsmAnd-core.  The build
instructions all seem to suggest building the legacy core.  I think i've
attempted something similar to those build instructions (following the fdroid
build) and it also did not use the master branch of OsmAnd-core.

The master branch of OsmAnd-core seems to use GPUs with a potential for
multi-threading, which seems quite exciting and overdue.  I'd like to get
involved with this if i can help, but there's no point in me messing with legacy
code when the new stuff has already been (to some extent) done.

Harry van der Wolf

unread,
Sep 19, 2016, 8:59:25 AM9/19/16
to osmand
I haven't built OsmAnd for over a year and did not follow the developments either.

I hope some of the devs will react.

And with regard to your remark: "but compilation takes all day". Only the first build as all external need to be compiled. Once that done they are not recompiles and your compilation runs should finish with 5-15 minutes (depending on your cpu, memory, ssd/hdd)

Harry

Karol Grudziński

unread,
Sep 20, 2016, 10:59:39 AM9/20/16
to Osmand
I've never compiled OsmAnd so I have to ask If I have all of compilation dependencies installed in system (by linux package manager) does OsmAnd will use my system's version or bundled?
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.

matt...@googlemail.com

unread,
Sep 22, 2016, 2:35:01 AM9/22/16
to Osmand
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!

Karol Grudziński

unread,
Sep 22, 2016, 8:24:28 AM9/22/16
to Osmand
W dniu czwartek, 22 września 2016 08:35:01 UTC+2 użytkownik matt...@googlemail.com napisał:
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!

 
I have android sdk (API 23, 21, 19, 16) and ndk (v11) installed because I'm learning programming android apps for several months

I compiled OsmAnd successfully from this guide -> https://groups.google.com/forum/#!msg/osmand/J0lcnZN0fLU/OT-4gQs_BwAJ
It took about 11 minutes first time on my very old laptop (i3 2.4 GHz, 8GiB of RAM). I tried running another assemble* tasks in gradle but no matter which I choose I can't get app to work on my phone. It install sucessfully but crash immediately after start.


Karol Grudziński

unread,
Sep 22, 2016, 2:07:12 PM9/22/16
to Osmand
I will answer my questions by myself :)

I restarted phone and compiled app starts normally, but I discovered that it was built without NDK so is incredibly slow :)

I've cloned osmand-core (info from https://github.com/osmandapp/OsmAnd-manifest/blob/master/readonly.xml) and started NDK build.

matt...@googlemail.com

unread,
Sep 22, 2016, 9:37:33 PM9/22/16
to Osmand
> I tried running another assemble* tasks in gradle but no matter which I choose I can't get app to work on my phone. It install sucessfully but crash immediately after start.

I think you have to be careful which assemble task you are running.  The instructions you gave compile the full version (assembleFull...).  This will compile a version of the native core for each possible chip architecture (i think).  If you call other assemble tasks, you might be building a version that contains only a single version of the core for a single architecture.  This might be why you're seeing problems running it on your phone (wrong arch).

Perhaps connecting your phone via usb and running "adb logcat" will enable you to see the console output of the program, including any errors that might occur.

matt...@googlemail.com

unread,
Sep 22, 2016, 9:43:20 PM9/22/16
to Osmand

The current status of my build attempt, following the instructions at https://github.com/osmandapp/OsmAnd-core are as follows:

  • I'm building armeabi-android-gcc.sh instead of amd64-linux-gcc.sh.
  • I had to correct build/target/android-gcc.cmake to set system_lib_dirs to include ${toolchain_root}/lib/gcc/${toolchain_prefix}/${toolchain_version}.x/${toolchain_lib_subpath}.  That is, i had to add ".x" after ${toolchain_version}.
  • Compilation currently fails with "cannot find -lgnustl_shared. This is frustrating since gnustl_shared is found using find_library(), which returns the full path.  At some point, CMake is throwing away the full path and then complaining that the library cannot be found...

Karol Grudziński

unread,
Sep 23, 2016, 5:22:54 AM9/23/16
to Osmand
Compile guide using Osmand-manifest is IMHO unnecessarily too complicated. You can make it manually and it just works.
My compile guide:
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

assembleFull means you build Full version instead of Free version, Legacy means you build with legacy core (instead of Qtcore), Fat means you build for every architecture (instead of e.g. armv7).
You can get possible combinations from ~/osmand/Osmand/OsmAnd/build.gradle

matt...@googlemail.com

unread,
Sep 23, 2016, 5:47:07 AM9/23/16
to Osmand

Thanks -- i have already been successful in building with the legacy core.  The purpose of this thread is that i want to build the core on the master branch (is the the QT Core?) for android, with the hope of exploiting the GPU and concurrency it uses.

Do you know if this is possible or a sensible idea?

Ideally, i'd like OsmAnd to render quickly on Android and if work needs to be done, i am keen to get involved.

Karol Grudziński

unread,
Sep 23, 2016, 5:54:26 AM9/23/16
to Osmand
I don't know yet how to do this but I will try compiling with new core this weekend. Fun fact: assembleFullQtcoreFatDebug compiles fine, but still uses core-legacy. Maybe I should try official tutorial like you did :)

Max

unread,
Sep 23, 2016, 6:44:37 AM9/23/16
to Osmand
Hi,

maybe the new core will be included in 3.0 (if I did understand Victor correctly).

Here is a quick guide how to build the new core.
But maybe I forgot something...

Checkout master branch of core.
I think it should work at least with NDK 10.
Maybe you need some additional SDK levels installed (9, 14, ..., I don't remember exactly) (for Qt), otherwise you will get errors, that something is missing.
Maybe you also need some dependencies, I don't remember, maybe it was only necessary for Desktop build...
export ANDROID_SDK= ANDROID_NDK= ANDROID_HOME=
(fill in your proper paths)
Build the core:
cd core/wrappers/android/
./gradlew clean build

Because the build may take long, you can reduce the architectures:
https://github.com/osmandapp/OsmAnd-core/blob/master/wrappers/android/build.sh
Maybe remove all, except of the one for your device, for example armeabi-v7a.

Maybe you also want to do only a release or debug build...

Next step will be, how to build OsmAnd which includes this new core...

Regards,
Max

matt...@googlemail.com

unread,
Sep 23, 2016, 10:31:27 AM9/23/16
to Osmand
Excellent, thanks -- currently i've been using the scripts that use cmake.  With these i've managed to get armeabi to compile to 88% so far after hacking away at the cmake files enough...  Once it's done i'm hoping OsmAnd will build with the new core in the same way as with the legacy version.  Though, given my fiddling with library paths, i'm not convinced my compiled core will work.  Perhaps the gradle build will work as distributed.

Karol Grudziński

unread,
Sep 24, 2016, 9:36:10 AM9/24/16
to Osmand
After spending whole yesterday evening I gave up on compiling this. I have installed all dependencies, almost every SDK version possible, tried NDK 11 and 10 and it didn't work. Every time compilation fails, because linker can't find gnustl_shared. Relevant part of compilation log:

[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

matt...@googlemail.com

unread,
Sep 24, 2016, 9:47:33 AM9/24/16
to Osmand
I ran into this exact problem and managed to fix it after a few days.  The problem seems to be that build/targets/android-gcc.cmake sets up the system directories to include the one containing libgnustl_shared.so.  Because of this, CMake strips the library's path (because it thinks it's a system lib) and thus can't find it when it tries to link (because it's not actually a system library).

I solved it by editing build/target/android-gcc.cmake so that it ends with the lines

 # Configure search paths
include_directories(SYSTEM ${system_include_dirs})
set(CMAKE_INCLUDE_PATH ${system_include_dirs})
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

#link_directories(${system_lib_dirs})
set(CMAKE_LIBRARY_PATH ${system_lib_dirs})
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

I.e. i commented out the link_directories command, and changed set(CMAKE_SYSTEM_LIBRARY_PATH ...) to just set(CMAKE_SYSTEM_LIBRARY_PATH).

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

and installing the generated APK.  I had to enable the developer plugin and check the "use opengl" option.  After that, i'm pretty sure i got the new core, since it draw a nice blue grid onto which the map tiles were rendered.  However, performance did not noticably improve over the legacy renderer, and crashes were frequent.

matt...@googlemail.com

unread,
Sep 25, 2016, 1:01:23 AM9/25/16
to Osmand

On Saturday, September 24, 2016 at 2:47:33 PM UTC+1, matt...@googlemail.com wrote:
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


I'm wrong here -- the Qtcore used appears to have been compiled separately as part of the gradle build -- i'm not sure where this one comes from.

matt...@googlemail.com

unread,
Sep 25, 2016, 3:30:10 AM9/25/16
to Osmand


On Friday, September 23, 2016 at 11:44:37 AM UTC+1, Max wrote:
Next step will be, how to build OsmAnd which includes this new core...

This is proving harder than i hoped! :)  Do you have an idea how to do it?

Also, do you know how to contact the developers -- i'm keen to help with improving rendering if i can, but i can't find any way of getting involved!

Karol Grudziński

unread,
Sep 25, 2016, 4:59:58 AM9/25/16
to Osmand
I'm pretty sure it isn't using new core because in first lines of compilation log I can see core-legacy path :-(

./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/../../..

And in build.gradle there are lines:

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"
    }
}

Changing to ./ndk-build.sh doesn't help, because now it isn't using NDK at all:

 $ ./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

matt...@googlemail.com

unread,
Sep 25, 2016, 5:46:07 AM9/25/16
to Osmand


On Sunday, September 25, 2016 at 9:59:58 AM UTC+1, Karol Grudziński wrote:
I'm pretty sure it isn't using new core because in first lines of compilation log I can see core-legacy path :-

Yep -- i was thrown off course since building the Qtcore version didn't appear to change anything for me until i'd built the new core manually.  I must have gotten confused somewhere.

On the other hand, building using gradle as Max suggested has built two .aar files (in core/wrappers/android/build/outputs/aar).  Looking at the dependencies defined in build.gradle in android/OsmAnd it looks like aar snapshots of the Qt core are used.  These are expanded in build/intermediates/exploded-aar.  Perhaps there is some way of pointing gradle at the locally generated aar files instead of (what i presume is) a downloaded snapshot.

matt...@googlemail.com

unread,
Sep 25, 2016, 6:27:26 AM9/25/16
to Osmand

On Sunday, September 25, 2016 at 10:46:07 AM UTC+1, matt...@googlemail.com wrote:
On the other hand, building using gradle as Max suggested has built two .aar files (in core/wrappers/android/build/
outputs/aar).  Looking at the dependencies defined in build.gradle in android/OsmAnd it looks like aar snapshots of the Qt core are used.  These are expanded in build/intermediates/exploded-aar.  Perhaps there is some way of pointing gradle at the locally generated aar files instead of (what i presume is) a downloaded snapshot.

Actually, the aar files in core/wrappers/android/NativeCore... look more like the names referenced in android/OsmAnd's build.gradle.

Karol Grudziński

unread,
Sep 25, 2016, 7:25:21 AM9/25/16
to Osmand
I changed last part of android/OsmAnd/build.gradle to use local .aar files, but I can't see a difference:
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"
}

matt...@googlemail.com

unread,
Sep 25, 2016, 7:46:03 AM9/25/16
to Osmand

On Sunday, September 25, 2016 at 12:25:21 PM UTC+1, Karol Grudziński wrote:
> I changed last part of android/OsmAnd/build.gradle to use local .aar files, but I can't see a difference:

Thanks for this.  I'm not super familiar with gradle, so i'll have to learn on the fly what to do.

If i add the flatDir setting as you did and clear android/OsmAnd/build, then it seems that gradle just recreates exploded-aar from the cache in ~/.gradle.  E.g. from

    ./.gradle/caches/modules-2/files-2.1/net.osmand/OsmAndCore_android/0.1-SNAPSHOT/a380e720a8c2164f581e48d1b514a0360351a400/OsmAndCore_android-0.1-SNAPSHOT.aar

So i suspect something else has to be done to make it really use the new .aar.  I'm looking into it a bit now, but am also trying to debug another project :)

Karol Grudziński

unread,
Sep 25, 2016, 7:51:32 AM9/25/16
to Osmand
I will try to find and delete all possible gradle cache and compile again.

matt...@googlemail.com

unread,
Sep 25, 2016, 8:50:15 AM9/25/16
to Osmand
The following appears to have worked for me (after clearing the build directory).  However, running with the new core results in "java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/net.osmand-1/lib/arm/libQt5Core.so" in the logcat.  After which it reverts to the legacy core.

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")
}




Reply all
Reply to author
Forward
0 new messages