-
Notifications
You must be signed in to change notification settings - Fork 23
Missing GL Context #23
Description
Tried to build android app with FLutter and got such error
I/native (27096): I0000 00:00:1738749696.941629 27096 session.cc:3633] Update Frame Delay to 0 frames. E/native (27096): E0000 00:00:1738749696.941986 27096 error_policy_util.cc:263] E/native (27096): ################ ARCore Native Error ################## E/native (27096): BUILD_CHANGELIST:696619763 E/native (27096): BUILD_BASELINE_CHANGELIST:695164409 E/native (27096): ################### Stack Trace Begin ################ E/native (27096): ARCoreError: third_party/arcore/ar/core/session.cc:1826 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/session.cc?g=0&l=1826 E/native (27096): ARCoreError: third_party/arcore/ar/core/c_api/session_lite_c_api.cc:76 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/c_api/session_lite_c_api.cc?g=0&l=76 E/native (27096): ################### Stack Trace End ################# E/native (27096): E/native (27096): ################### Undecorated Trace Begin ################# E/native (27096): FAILED_PRECONDITION: E/native (27096): ARCoreError: third_party/arcore/ar/core/session.cc:1826 E/native (27096): at third_party/arcore/ar/core/session.cc:1826 [type.googleapis.com/util.ErrorSpacePayload='ArStatusErrorSpace::AR_ERROR_MISSING_GL_CONTEXT'] E/native (27096): === Source Location Trace: === E/native (27096): third_party/arcore/ar/core/session.cc:1826 E/native (27096): E/native (27096): ################### Undecorated Trace End ################# D/AndroidRuntime(27096): Shutting down VM E/AndroidRuntime(27096): FATAL EXCEPTION: main E/AndroidRuntime(27096): Process: com.empat.tech.arcore.example.ar_core_example, PID: 27096 E/AndroidRuntime(27096): com.google.ar.core.exceptions.MissingGlContextException E/AndroidRuntime(27096): at java.lang.reflect.Constructor.newInstance0(Native Method) E/AndroidRuntime(27096): at java.lang.reflect.Constructor.newInstance(Constructor.java:343) E/AndroidRuntime(27096): at com.google.ar.core.Session.throwExceptionFromArStatus(Session.java:16) E/AndroidRuntime(27096): at com.google.ar.core.Session.nativeUpdate(Native Method) E/AndroidRuntime(27096): at com.google.ar.core.Session.update(Session.java:2) E/AndroidRuntime(27096): at com.google.ar.sceneform.ArSceneView.onBeginFrame(SourceFile:102) E/AndroidRuntime(27096): at com.google.ar.sceneform.SceneView.doFrameNoRepost(SourceFile:90) E/AndroidRuntime(27096): at com.google.ar.sceneform.SceneView.doFrame(SourceFile:86) E/AndroidRuntime(27096): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:973) E/AndroidRuntime(27096): at android.view.Choreographer.doCallbacks(Choreographer.java:799) E/AndroidRuntime(27096): at android.view.Choreographer.doFrame(Choreographer.java:730) E/AndroidRuntime(27096): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:960) E/AndroidRuntime(27096): at android.os.Handler.handleCallback(Handler.java:938) E/AndroidRuntime(27096): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(27096): at android.os.Looper.loop(Looper.java:236) E/AndroidRuntime(27096): at android.app.ActivityThread.main(ActivityThread.java:8057) E/AndroidRuntime(27096): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(27096): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620) E/AndroidRuntime(27096): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011) D/libMEOW (27096): applied 1 plugins for [com.empat.tech.arcore.example.ar_core_example]: D/libMEOW (27096): plugin 1: [libMEOW_gift.so]: I/Process (27096): Sending signal. PID: 27096 SIG: 9
Maybe there is something that could help?
Android manifest -
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera.ar" /> <application> <meta-data android:name="com.google.ar.core" android:value="optional" tools:replace="android:value" /> <meta-data android:name="com.google.ar.core.min_apk_version" android:value="220110220" tools:replace="android:value" /> <meta-data android:name="android.opengl.version" android:value="0x00030000" /> </application> <uses-feature android:glEsVersion="0x00030000" android:required="true" /> </manifest>
app/build.gradle
`plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.ar.sceneform.plugin'
android {
namespace = "com.empat.tech.arcore.example.ar_core_example"
compileSdk = flutter.compileSdkVersion
ndkVersion = "25.1.8937393"
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId = "com.empat.tech.arcore.example.ar_core_example"
minSdk = 24
targetSdk = 34
versionCode = flutter.versionCode
versionName = flutter.versionName
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig = signingConfigs.debug
}
}
packagingOptions {
pickFirst 'lib/**/libc++_shared.so'
pickFirst 'lib/**/libarcore_c.so'
}
}
flutter {
source = "../.."
}
dependencies {
implementation 'com.google.ar:core:1.46.0'
implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.8.0'
implementation 'com.google.ar.sceneform:core:1.8.0'
}
`