72

I'm getting this warning as the first line from my app in logcat, and I have no idea what it refers to and how I should go about fixing it. Google doesn't offer much info on this (in fact, none at all). Please advise. What kind of flags might this be about? Is there a way to find out what the specified bit might refer to (or, perhaps, has been referring to on older Android versions but has become invalid in Android 10)? There is no such line in the log on Android 9 or earlier versions.

Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335

4 Answers4

21

I bring a stone to the building. I retrace the code for the error message. It is at line 345 in the C ++ file dalvik_system_ZygoteHooks.cc At a minimum, if (runtime_flags! = 0) then the error message will be printed. 0x8000 also corresponds to the USE_APP_IMAGE_STARTUP_CACHE flag (see line 157). The test on the USE_APP_IMAGE_STARTUP_CACHE flag is done on line 340. Normally, runtime_flags should no longer have a raised bit for USE_APP_IMAGE_STARTUP_CACHE but this does not seem to be the case since the error is printed.

But in the end, the error does not seem to have an impact on the application.

Pierre Lepage
  • 368
  • 2
  • 8
  • Should we worry about this? Is there a way to overcome it? It seems to exist even on Android API 29... – android developer Mar 02 '20 at 19:30
  • 2
    I pushed my research a little further. I have only one track to suggest without a definitive solution. A simple search on "USE_APP_IMAGE_STARTUP_CACHE" led me to line 107 of the Zygote.java module where the constant is defined. Continuing my research, I ended up in ART (Android Runtime) (runtime.h) at line 922. On this line is the method SetLoadAppImageStartupCacheEnabled which initializes load_app_image_startup_cache_. In short, the warning seems to be linked to the initialization of a cache memory for the image of the Android runtime. – Pierre Lepage Mar 04 '20 at 00:15
  • My app gets a list of tasks from the web in a JSON file. Then the users can select them day by day back and forth and the app show them the tasks relating to the selected date. When I have this error the app doesn't show anything relating to that date. If you ignore and keep changing date, eventually it will work again. – Reginaldo Rigo Jun 10 '20 at 17:58
4

I searched and I have some suggestion to you.

First of all take a look at this links:

hexadecimal-0x8000

difference between constants 32768 and 0x8000

Now this links may be can help you :

Android Fragment no view found for ID

FLAG_ACTIVITY_CLEAR_TOP

addFlags(0x8000)

and last thing is:

Uninstall App from emulator and Run project Again.

First Edit:

I Searched again and i think we are close to answer, so please check this links and say what do you think? are they Irrelevant? or we are on the right way.

...

AConfiguration

org.robolectric.res.android

Class AConfiguration

ACONFIGURATION_SCREEN_ROUND

public static final int ACONFIGURATION_SCREEN_ROUND

...

\sdk\ndk-bundle\sysroot\usr\include\android

configuration.h

   * Bit mask for
   * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">layout direction</a>
   * configuration.

   ACONFIGURATION_LAYOUTDIR = 0x4000,
   ACONFIGURATION_SCREEN_ROUND = 0x8000

...

https://developer.android.com/ndk/reference/group/configuration

android_ndk_sys

 Constant : ACONFIGURATION_SCREEN_ROUND
 ->
 Constant android_ndk_sys::ACONFIGURATION_SCREEN_ROUND
 pub const ACONFIGURATION_SCREEN_ROUND: _bindgen_ty_3
 ->
 Type Definition android_ndk_sys::_bindgen_ty_3

 type _bindgen_ty_3 = u32;

...

ACAMERA_VENDOR = 0x8000

 ACAMERA_VENDOR = 0x8000
 ACAMERA_DISTORTION_CORRECTION << 16,
   ACAMERA_HEIC_START = ACAMERA_HEIC << 16,
   ACAMERA_HEIC_INFO_START = ACAMERA_HEIC_INFO << 16,
   ACAMERA_VENDOR_START = ACAMERA_VENDOR << 16
Hamed Karami
  • 405
  • 1
  • 6
  • 28
  • 3
    So 0x8000 is `Intent.FLAG_ACTIVITY_CLEAR_TASK`, good find. But it's not deprecated, why would it be "unknown bits"? https://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TASK – Violet Giraffe Oct 15 '19 at 20:25
  • Regarding your edit, I don't think that's relevant since that is some 3rd-party class / software I've never heard of before. – Violet Giraffe Oct 22 '19 at 10:38
4

In my case at least happens because The fragment tried to update the view (or something like this) when a different activity was already running so just

@Override
public void onStop() {
    super.onStop();
    getActivity().finish();
}

inside the fragment solved this error

sivi
  • 10,654
  • 2
  • 52
  • 51
  • At least use requireActivity() which is more readable and also more android style – finki Dec 03 '19 at 12:28
  • You are assuming that android has style ... Actually this part is not really related to the solution it was added by the android studio. Thanks for adding this option you could have just edited the answer I think.. – sivi Dec 06 '19 at 08:23
  • Doesn't solve on Android API 24 – Alexey S. Larionov Feb 14 '23 at 13:04
0

Not sure if this will help anyone else, but I found I only get this peculiar error only on an Emulator! so maybe a bug with Emulator ‍♂️ .

Anyway, I suggest testing on a real device as this is the second time this sort of issues wasting so much of my time to investigate, I won't trust the Emulators anymore especially when they do not give a clear error log.

bastami82
  • 5,955
  • 7
  • 33
  • 44
  • 1
    i am facing this error on a real device now E/m.realmjava: Unknown bits set in runtime_flags: 0x8000 – sandeep Dec 14 '21 at 18:41