在尝试执行我的项目后尝试在android studio 2.3.1
中创建一个简单的数学游戏时,应用程序在模拟器中关闭并发出警告;
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...
我尝试解决问题,但我不明白为什么会出现这些警告并如何解决这些问题!
答案 0 :(得分:4)
您不需要解决此问题,因为根据源代码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;
}
x86_known_variants
的定义是
static constexpr const char* x86_known_variants[] = {
"atom",
"sandybridge",
"silvermont",
"kabylake",
};
如果您的仿真器或设备是x86_64
或x86
,您将看到此警告,可以忽略该警告。