53

Has anyone seen this before?

ActivityManager: WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.

This occurs as I'm trying to deploy an app to my device. Google doesn't seem to help at this point.

BryanH
  • 5,826
  • 3
  • 34
  • 47
ajacian81
  • 7,419
  • 9
  • 51
  • 64
  • 1)Deploying to device or emulator? 2)Android Studio being used? – AndyFaizan Feb 17 '14 at 19:27
  • 1
    Were this your own jni library the solution would be at http://stackoverflow.com/questions/20141538/mylib-so-has-text-relocations-this-is-wasting-memory-and-is-a-security-risk-pl however **as this appears to be in a platform library** there is really nothing you can do. You'll likely see this on every Activity process startup, until your device manufacturer does an update. It is only a warning though. – Chris Stratton Feb 17 '14 at 19:27
  • 3
    I'm using the Genymotion emulator from Eclipse. Haven't tested with a device yet. – ajacian81 Feb 17 '14 at 19:28
  • @ChrisStratton So what you're saying is that this exception is happening on the device level and is not part of the build process (or any plugins)? – ajacian81 Feb 17 '14 at 19:29
  • Most people who've had this issue have tried to deploy the app before the emulator has started properly. Did you try to do something similar? – AndyFaizan Feb 17 '14 at 19:32
  • 5
    @AndyFaizan - this is not an error, but a warning. It's possible that it is only generated once when zygote loads libdvm.so (everyone else simply inherits it) and so only *seen* in a special startup timing case, but the facts of the situation would be the same regardless. And there's nothing the poster can do to change that, other than eventually changing to a system image built with different toolchain settings. (Actually, the *act of installation* (or more specifically dexopting) may involve loading libdvm.so into a fresh process and so re-generating the warning) – Chris Stratton Feb 17 '14 at 19:38
  • @ajacian81 yes, since it's libdvm.so you are in no way the cause of this, rather the responsibility is with whoever compiled Android sources to generate the system image you are using on your emulator or device. – Chris Stratton Feb 17 '14 at 19:42
  • @ChrisStratton IF you want to add your comment as an answer so I can close this question that would be appreciated. – ajacian81 Mar 25 '14 at 22:09
  • Whoever marked this as a possible duplicate is mistaken as clearly it's not. – ajacian81 Aug 04 '14 at 05:09

4 Answers4

29

Were this your own jni library or native executable the solution would be to update to ndk r8c or later as discussed at:

mylib.so has text relocations. This is wasting memory and is a security risk. Please fix

in order to obtain a fix for https://code.google.com/p/android/issues/detail?id=23203

However as this appears to be in a platform library (specifically the Dalvik VM itself) rather than something you built, there is not much of anything you can do. You'll likely see this on every Activity process (or at least runtime) startup, until your device manufacturer does an update.

It is only a warning though.

Community
  • 1
  • 1
Chris Stratton
  • 39,853
  • 6
  • 84
  • 117
  • 14
    I'm receiving the same warning when deploying to an emulator. – Ted Hopp May 08 '14 at 20:05
  • 1
    Same error with ndk-r9d while installing apk to emulator. – Olcay Ertaş May 19 '14 at 01:57
  • @OlcayErtaş - the NDK version used is irrelevant for *this exact warning* (again, it is warning, **not an error**) as it is triggered by the code of the device/emulator itself, not by the code of your app. Changing NDK versions only helps when it is triggered by code you ship as part of your app. – Chris Stratton May 19 '14 at 14:05
  • 2
    This warning prevents me installing apk to emulator. – Olcay Ertaş May 19 '14 at 22:09
  • 6
    No, it does not. It is merely a warning, **not an error**. If you are actually unable to install, you must be having a **different problem** which belongs in its own question - but in your new question you will have to report an actual *error* rather than *warning* message to receive help. – Chris Stratton May 20 '14 at 00:19
  • FYI - I'm running the latest Android Studio 1.5.1 and still seeing this error. – raddevus Mar 13 '16 at 16:17
  • @daylight - This is **not an error** and it has **nothing to do with your work** but depends only on the software placed on your device by its manufacturer. There's nothing for you to do here, no action you can (or need to) take unless there is an available system update for your device or you feel like replacing it with a newer one *for some other reason*. – Chris Stratton Mar 13 '16 at 17:51
  • @ChrisStratton thanks. I was attempting to post to let others who are running android studio that they may see the problem also. I understand it is related to the Dalvik VM libraries. Thanks for your explanation. – raddevus Mar 13 '16 at 19:51
9

I was getting this error because I was trying to install an APK with minSdkVersion set higher than the device supported.

Seth W. Klein
  • 194
  • 2
  • 8
  • This is getting voted down, but I'm stubbornly leaving it in case it helps someone else who made the same mistake I did. – Seth W. Klein Dec 13 '15 at 20:37
  • This seems to be a mistake that some noobs like me will do. Why does anyone downvote this? – Neerkoli Dec 17 '15 at 08:47
  • The downvotes were (probably) because this answer is unrelated to the question. It's certainly helpful advice in general (as seen by the fact that it now has a positive score), but solves a different problem than the one being asked. – Hylianpuffball Mar 11 '16 at 14:38
  • 1
    My answer is related to the problem being asked (sic) because, under some circumstances, the action I implicitly suggest makes the error in the OP stop appearing. Sure, that doesn't make sense, but that's why the answer was worth posting. – Seth W. Klein Mar 12 '16 at 17:51
  • 1
    @SethW.Klein - no, it is not related. This question is about libdvm.so which is not part of an app, but rather part of system software. Your are confusing something unrelated, and so your post is not a useful contribution here. The warning given in this question is not one which any app developer can make go away - trying to do so is merely wasting your time and everyone elses'. – Chris Stratton Mar 13 '16 at 17:48
  • @ChrisStratton - disagree with your conclusion - as I got here after installing an androidTest to an emulator and seeing this error for the first time. However my minSdkVersion is 17 and I am installing to an API19 emulator. Nevertheless it is worthwhile knowing this factoid. "$ adb shell pm install -t -r "/data/local/tmp/com.jimandreas.aarch.popm.test" WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix. pkg: /data/local/tmp/com.jimandreas.aarch.popm.test" – Jim Andreas Aug 09 '17 at 09:02
  • @JimAndreas **you are simply wrong**. While libdvm.so is along with many other system libraries used by your app, **libdvm.so part of Android itself, not under your control**, so the warning is neither your fault, nor fixable by you other than by switching to an Android version that doesn't suffer it. You could only fix the warning directly if it were on code that you control, which it isn't. – Chris Stratton Aug 09 '17 at 11:29
5

I had the same error and i fixed it by removing other versions of the app installed on the device.

Lea
  • 151
  • 3
  • 11
0

There may be so many reasons behind this error, one of them was what I was getting, but then this error was solved.

check while creating emulator, it is 'compatible' or not? on Emulator selection screen [see for last column].

if not compatible, then select 'target sdk' as the highest version by editing existing 'Emulator' [as it should be greater than min sdk].

Bhrugs
  • 53
  • 8
  • No. **This has nothing to do with the question**. Like many of the other people who have posted unhelpful answers, you are confusing unrelated issues - at best you've merely switched to an emulator with an Android version that doesn't include the check that would generate the warning, but would still be there on a device that does. The actual cause of the warning message is clearly explained, including **the fact that there is nothing a developer can do about it** when it occurs in *system* code, as stated here. The only time a developer can take action is when it occurs in their code. – Chris Stratton Feb 16 '17 at 16:19