Unfortunately Osmand~ has stopped working

570 views
Skip to first unread message

eM

unread,
Feb 23, 2014, 8:19:02 AM2/23/14
to osm...@googlegroups.com
There are no compile errors in my local OsmAnd GIT repository. But I get the message "Unfortunately Osmand~ has stopped working" when I launch Osmand in both emulator and Samsung phone. Please help me with this I'm trying to run OsmAnd for nearly a week now. Below is my LogCat:

02-23 08:16:24.601: E/net.osmand(1988): NativeOsmandLibrary Failed to load native library
02-23 08:16:24.601: E/net.osmand(1988): java.lang.UnsatisfiedLinkError: Couldn't load gnustl_shared from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/net.osmand.plus-1.apk"],nativeLibraryDirectories=[/data/app-lib/net.osmand.plus-1, /system/lib]]]: findLibrary returned null
02-23 08:16:24.601: E/net.osmand(1988): at java.lang.Runtime.loadLibrary(Runtime.java:358)
02-23 08:16:24.601: E/net.osmand(1988): at java.lang.System.loadLibrary(System.java:526)
02-23 08:16:24.601: E/net.osmand(1988): at net.osmand.plus.render.NativeOsmandLibrary.getLibrary(NativeOsmandLibrary.java:38)
02-23 08:16:24.601: E/net.osmand(1988): at net.osmand.plus.OsmandApplication.startApplicationBackground(OsmandApplication.java:510)
02-23 08:16:24.601: E/net.osmand(1988): at net.osmand.plus.OsmandApplication.access$3(OsmandApplication.java:497)
02-23 08:16:24.601: E/net.osmand(1988): at net.osmand.plus.OsmandApplication$6.run(OsmandApplication.java:488)
02-23 08:16:24.601: E/net.osmand(1988): at java.lang.Thread.run(Thread.java:841)
02-23 08:16:24.631: E/AndroidRuntime(1988): FATAL EXCEPTION: Initializing app
02-23 08:16:24.631: E/AndroidRuntime(1988): Process: net.osmand.plus, PID: 1988
02-23 08:16:24.631: E/AndroidRuntime(1988): java.lang.NullPointerException
02-23 08:16:24.631: E/AndroidRuntime(1988): at net.osmand.util.Algorithms.streamCopy(Algorithms.java:118)
02-23 08:16:24.631: E/AndroidRuntime(1988): at net.osmand.plus.resources.ResourceManager.indexRegionsBoundaries(ResourceManager.java:420)
02-23 08:16:24.631: E/AndroidRuntime(1988): at net.osmand.plus.resources.ResourceManager.checkAssets(ResourceManager.java:463)
02-23 08:16:24.631: E/AndroidRuntime(1988): at net.osmand.plus.resources.ResourceManager.reloadIndexes(ResourceManager.java:402)
02-23 08:16:24.631: E/AndroidRuntime(1988): at net.osmand.plus.OsmandApplication.startApplicationBackground(OsmandApplication.java:517)
02-23 08:16:24.631: E/AndroidRuntime(1988): at net.osmand.plus.OsmandApplication.access$3(OsmandApplication.java:497)
02-23 08:16:24.631: E/AndroidRuntime(1988): at net.osmand.plus.OsmandApplication$6.run(OsmandApplication.java:488)
02-23 08:16:24.631: E/AndroidRuntime(1988): at java.lang.Thread.run(Thread.java:841)
02-23 08:16:24.651: E/StrictMode(1988): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
02-23 08:16:24.651: E/StrictMode(1988): java.lang.Throwable: Explicit termination method 'close' not called
02-23 08:16:24.651: E/StrictMode(1988): at dalvik.system.CloseGuard.open(CloseGuard.java:184)
02-23 08:16:24.651: E/StrictMode(1988): at java.io.FileOutputStream.<init>(FileOutputStream.java:90)
02-23 08:16:24.651: E/StrictMode(1988): at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
02-23 08:16:24.651: E/StrictMode(1988): at net.osmand.plus.resources.ResourceManager.indexRegionsBoundaries(ResourceManager.java:421)
02-23 08:16:24.651: E/StrictMode(1988): at net.osmand.plus.resources.ResourceManager.checkAssets(ResourceManager.java:463)
02-23 08:16:24.651: E/StrictMode(1988): at net.osmand.plus.resources.ResourceManager.reloadIndexes(ResourceManager.java:402)
02-23 08:16:24.651: E/StrictMode(1988): at net.osmand.plus.OsmandApplication.startApplicationBackground(OsmandApplication.java:517)
02-23 08:16:24.651: E/StrictMode(1988): at net.osmand.plus.OsmandApplication.access$3(OsmandApplication.java:497)
02-23 08:16:24.651: E/StrictMode(1988): at net.osmand.plus.OsmandApplication$6.run(OsmandApplication.java:488)
02-23 08:16:24.651: E/StrictMode(1988): at java.lang.Thread.run(Thread.java:841)
02-23 08:16:25.441: E/WindowManager(1988): android.view.WindowLeaked: Activity net.osmand.plus.activities.MainMenuActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{b3218e50 V.E..... R.....I. 0,0-480,254} that was originally added here
02-23 08:16:25.441: E/WindowManager(1988): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:348)
02-23 08:16:25.441: E/WindowManager(1988): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
02-23 08:16:25.441: E/WindowManager(1988): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
02-23 08:16:25.441: E/WindowManager(1988): at android.app.Dialog.show(Dialog.java:286)
02-23 08:16:25.441: E/WindowManager(1988): at android.app.AlertDialog$Builder.show(AlertDialog.java:951)
02-23 08:16:25.441: E/WindowManager(1988): at net.osmand.plus.activities.MainMenuActivity.checkPreviousRunsForExceptions(MainMenuActivity.java:97)
02-23 08:16:25.441: E/WindowManager(1988): at net.osmand.plus.activities.MainMenuActivity.onCreate(MainMenuActivity.java:294)
02-23 08:16:25.441: E/WindowManager(1988): at android.app.Activity.performCreate(Activity.java:5231)
02-23 08:16:25.441: E/WindowManager(1988): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
02-23 08:16:25.441: E/WindowManager(1988): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
02-23 08:16:25.441: E/WindowManager(1988): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
02-23 08:16:25.441: E/WindowManager(1988): at android.app.ActivityThread.access$800(ActivityThread.java:135)
02-23 08:16:25.441: E/WindowManager(1988): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
02-23 08:16:25.441: E/WindowManager(1988): at android.os.Handler.dispatchMessage(Handler.java:102)
02-23 08:16:25.441: E/WindowManager(1988): at android.os.Looper.loop(Looper.java:136)
02-23 08:16:25.441: E/WindowManager(1988): at android.app.ActivityThread.main(ActivityThread.java:5017)
02-23 08:16:25.441: E/WindowManager(1988): at java.lang.reflect.Method.invokeNative(Native Method)
02-23 08:16:25.441: E/WindowManager(1988): at java.lang.reflect.Method.invoke(Method.java:515)
02-23 08:16:25.441: E/WindowManager(1988): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
02-23 08:16:25.441: E/WindowManager(1988): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
02-23 08:16:25.441: E/WindowManager(1988): at dalvik.system.NativeStart.main(Native Method)

eM

unread,
Feb 23, 2014, 8:34:54 AM2/23/14
to osm...@googlegroups.com
By the way I have an older version (2013) which works well. But it doesn't have all the features in the latest version. Please help me to run the new version of OsmAnd!!!

Harry van der Wolf

unread,
Feb 26, 2014, 11:15:57 AM2/26/14
to osmand
You compiled with native library enabled, but somehow the gnustl_shared library didn't make it into your apk. When installing osmand these libraries get copied/installed into "data/app-lib/net.osmand.plus-1/system/lib", however your error message mentions "
data/app-lib/net.osmand.plus-1, /system/lib". There is a comma. I don't know whether this is correct behaviour and your gnustl library is not there, or that somehow during build this comma came in and osmand tries to search the incorrect library path for this library.

I guess the entire compilation went well, but the building of the apk itself not. Have you tried with one of the lates-night builds? If you simply compile from git, then these nightly builds are just as up-to-date.
Note: It can sometimes help to install OsmAnd, not to start it (!), Go to the app settings, stop OsmAnd, delete data, uninstall OsmAnd, and then re-install OsmAnd.

(I'm on wintersport holidays with limited internet access).

Harry


2014-02-23 14:34 GMT+01:00 eM <mbs...@gmail.com>:
By the way I have an older version (2013) which works well. But it doesn't have all the features in the latest version. Please help me to run the new version of OsmAnd!!!

--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

MB VPN

unread,
Feb 28, 2014, 2:10:24 AM2/28/14
to osm...@googlegroups.com
Your help is much appreciated! I will post the results ASAP!


(Enjoy your holidays!)


--
You received this message because you are subscribed to a topic in the Google Groups "Osmand" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/osmand/-iJ5KQCvoTg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to osmand+un...@googlegroups.com.

eM

unread,
Mar 3, 2014, 2:29:52 AM3/3/14
to osm...@googlegroups.com
I have tried my best to make OsmAnd run on my emulator and Samsung S4 phone, but failed because of the above mentioned error. Can someone please help me by letting me download a successfully working project of OsmAnd source code (Android project) through a link provided by you other than Github.

(Harry is it possible for you to provide a link please)

Thanks for all of your help so far please help me to run OsmAnd without this error!

Harry van der Wolf

unread,
Mar 3, 2014, 1:21:49 PM3/3/14
to osmand
How did you compile it anyway?
Do you build the "old build" version or the qt version?
Did you follow this article? http://code.google.com/p/osmand/wiki/InstallDevelopmentEnvironment

I see that it needs some more explanation perhaps. I haven't compiled OsmAnd for quite some time.

So instead of a link I explain my (simplified) workflow.
What I do (based on that wiki page) on my linux box. The commands between () only initially

===
cd /opt/software
(mkdir osmandapp)
cd osmandapp
(repo init -u https://github.com/osmandapp/OsmAnd-manifest -m r_1.5.xml)
repo sync -d

export ANDROID_SDK=/opt/software/android-sdk-linux
export ANDROID_NDK=/opt/software/android-ndk-r8e

./android/OsmAnd/old-ndk-build.sh
===
This will build all the basic stuff, the dependencies and the native library


The above command(s)  will build an arm,x86 and mips combined apk.
If you only want ARM (or one of the others) do (for ARM):
"export OSMAND_ARM_ONLY=true" before(!) the final "./android/OsmAnd/old-ndk-build.sh" command.
(I only want an ARM version (16MB instead of 22MB). I'm not interested in other architectures)


Make sure that the last line of your "./android/OsmAnd/old-ndk-build.sh" command compilation run end with:
"Install        : libgnustl_shared.so => libs/armeabi/libgnustl_shared.so"

To compile the apk finally do
===
cd android/OsmAnd
ant -file build.xml -Dsdk.dir=$ANDROID_SDK -Dndk.dir=$ANDROID_NDK -Dnativeoff=false -Dmanifest="/opt/software/
osmandapp/android/OsmAnd/AndroidManifest.xml" clean debug
===

There are quite some other options to add to the ant command, but please try this one first.

After the ant compilation you will find the "OsmAnd-debug.apk" inside the bin folder. Copy (and rename) it to your phone. Try to install and test.

I just compiled it for myself from a cleanly created repo sync and it works fine apart from the fact that I see some rendering defects which I assume come from some changes 5 hours ago.


Harry

Harry van der Wolf

unread,
Mar 3, 2014, 1:28:35 PM3/3/14
to osmand
The rendering defects are caused by a new change inside Osmand for the world_basemap. That change obviously does not work as intended. It overlays the world basemap on top of the regular map, also at high zoomlevels.

Harry

Harry van der Wolf

unread,
Mar 3, 2014, 1:58:01 PM3/3/14
to osmand
I'm wrong again (I already mentioned that I compiled OsmAnd quiter some time back for the last time).
Do not use the ARM only step. That causes the behavior. just compile the arm/x86/mips combined version.

Harry

eM

unread,
Mar 7, 2014, 6:27:05 AM3/7/14
to osm...@googlegroups.com
@Harry Really interesting findings. Keep up your good work helping the new comers like me! I will post the results ASAP.

Amir Moosavi

unread,
May 14, 2014, 12:22:31 PM5/14/14
to osm...@googlegroups.com
Thank you Harry for your replies.
I have the same problem but my platform is win7 x64 and I wonder if you could tell me what to do! If you tell me, I would migrate  to Linux but i prefer to work with Windows.

Amir Moosavi

unread,
May 22, 2014, 4:53:41 AM5/22/14
to osm...@googlegroups.com
Thank you every body
My problem solved by using ant.
Reply all
Reply to author
Forward
0 new messages