java.lang.RuntimeException:createContext失败: [英] java.lang.RuntimeException: createContext failed:
问题描述
我正在使用Emulator 7.1.1(Google Apis)
.
完全例外是
I am using Emulator 7.1.1(Google Apis)
.
Full exception is
E/AndroidRuntime: FATAL EXCEPTION: GLThread 309
java.lang.RuntimeException: createContext failed: 12291
at com.google.maps.api.android.lib6.gmm6.vector.bi.a(:com.google.android.gms.DynamiteModulesB:834)
at com.google.maps.api.android.lib6.gmm6.vector.bj.f(:com.google.android.gms.DynamiteModulesB:20825)
at com.google.maps.api.android.lib6.gmm6.vector.bj.run(:com.google.android.gms.DynamiteModulesB:881)
该代码在samsung galaxy J5
上正常运行,但在emulator
上无效.我已经在Google&上搜索过我在此错误上浪费了2个小时&仍然找不到解决方案.任何帮助将不胜感激.
The code is working fine on samsung galaxy J5
but not working on emulator
. I have searched on google & my 2 hours wasted on this error & still not able to find the solution. Any help will be appreciated.
我的build.gradle
文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.katariya.pomoc"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.google.android.gms:play-services-gcm:10.2.1'
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.android.support:support-v4:25.3.0'
compile 'com.android.support:multidex:1.0.0'
compile 'commons-io:commons-io:2.4'
}
apply plugin: 'com.google.gms.google-services'
推荐答案
我明白了!
我进入了模拟器本身的设置,并将 OpenGL ES渲染从基于主机自动检测(默认)更改为台式机本机OpenGL .之后,我的应用程序开始完美运行.这是一个清晰的屏幕截图,希望这对以后有所帮助!
I went into the settings of the emulator itself and changed OpenGL ES render from Autodetect based on host (default) to Desktop native OpenGL. After that my app began working perfectly. Here is a screenshot for clarity, hope this helps somebody in the future!
这篇关于java.lang.RuntimeException:createContext失败:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!