Error: Unexpected CPU variant for X86 using defaults: x86

核能气质少年 提交于 2020-04-29 08:02:21

问题


While trying to create a simple math game in android studio 2.3.1 after trying to execute my project, the app closes in emulator and gives warnings;

5-17 06:52:14.573 3088-3088/com.example.hp.game W/art: Unexpected CPU variant for X86 using defaults: x86
05-17 06:52:14.744 3088-3088/com.example.hp.game W/System: ClassLoader referenced unknown path: /data/app/com.example.hp.game-1/lib/x86
05-17 06:52:14.877 3088-3104/com.example.hp.game W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...

And I tried solving the problem, but I do not understand why these warnings come up and how to fix them!


回答1:


You don't need to fix this as it is just a warning according to source code https://android.googlesource.com/platform/art/+/master/runtime/arch/x86/instruction_set_features_x86.cc.

// Verify that variant is known.
bool known_variant = FindVariantInArray(x86_known_variants, arraysize(x86_known_variants),
                                          variant);
if (!known_variant && variant != "default") {
    LOG(WARNING) << "Unexpected CPU variant for X86 using defaults: " << variant;
}

The definition for x86_known_variants is

static constexpr const char* x86_known_variants[] = {
    "atom",
    "sandybridge",
    "silvermont",
    "kabylake",
};

If your emulators or devices are x86_64 or x86 you will see this warning which can be ignored.



来源:https://stackoverflow.com/questions/44022615/error-unexpected-cpu-variant-for-x86-using-defaults-x86

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!