Closing Activity causes surface buffer errors with monogame - android

I have a monogame game from which I'm launching an activity in order to login. The game runs fine. When I launch the activity it also runs fine and the gameloop appears to be blocked. The real problem comes when I Finish() the activity or perform OnBackPressed(). I get surface buffer errors, the screen goes black but the game loop resumes. If I try turning off Host GPU in the emulator, the app will instead crash when closing the activity.
When activity opens:
[EGL_emulation] tid 18496: eglSurfaceAttrib(1210): error 0x3009 (EGL_BAD_MATCH)
[OpenGLRenderer] Failed to set EGL_SWAP_BEHAVIOR on surface 0x81448da0, error=EGL_BAD_MATCH
When back pressed in activity or calling Finish():
[EGL_emulation] eglMakeCurrent: 0xa4805a80: ver 2 0 (tinfo 0x82aff0b0)
[EGL_emulation] tid 18496: eglSurfaceAttrib(1210): error 0x3009 (EGL_BAD_MATCH)
[OpenGLRenderer] Failed to set EGL_SWAP_BEHAVIOR on surface 0x81456b00, error=EGL_BAD_MATCH
[EGL_emulation] eglMakeCurrent: 0xa4805a80: ver 2 0 (tinfo 0x82aff0b0)
[Surface] getSlotFromBufferLocked: unknown buffer: 0x0
[EGL_emulation] tid 18458: swapBuffers(531): error 0x300d (EGL_BAD_SURFACE)
[IInputConnectionWrapper] finishComposingText on inactive InputConnection
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
Without using host gpu it crashes with:
[Surface] getSlotFromBufferLocked: unknown buffer: 0x7a697320

Unfortunately I ended up having to create my own soft keyboard in monogame and therefore no longer launch any android activities.

Related

DeadSystemException: The system died; earlier logs will point to the root cause

The app is crashed when opening the camera/image gallery, but not sure what the problem is.
D/ViewRootImpl#c86a903[MainActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x5 surface={valid=false 0} changed=true
D/ViewRootImpl#c86a903[MainActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x1 surface={valid=false 0} changed=false
E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 12216)
E/Parcel: Invalid object type 0x00660037
D/AndroidRuntime: Shutting down VM
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
DeadSystemException: The system died; earlier logs will point to the root cause
D/TransportRuntime.SQLiteEventStore: Storing event with priority=HIGHEST, name=FIREBASE_CRASHLYTICS_REPORT for destination cct
D/TransportRuntime.JobInfoScheduler: Scheduling upload for context TransportContext(cct, HIGHEST, MSRodHRwczovL2NyYXNobHl0aWNzcmVwb3J0cy1wYS5nb29nbGVhcGlzLmNvbS92MS9maXJlbG9nL2xlZ2FjeS9iYXRjaGxvZ1xBSXphU3lCcnBTWVQ0RkZMMDlyZUhKaTZIOUZZZGVpU25VVE92Mk0=) with jobId=-407685770 in 1000ms(Backend next call timestamp 1638127305049). Attempt 1
Disconnected from the target VM, address: 'localhost:64975', transport: 'socket'

java.lang.NullPointerException: DataBindingUtil.setConte….layout.activity_chapter) must not be null

I have just build a project with android kotlin but when I run the app it got crash, and in the logcat I found this error
java.lang.NullPointerException: DataBindingUtil.setConte….layout.activity_chapter) must not be null
ChapterActivity.kt
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import com.tutorial.kotlinfirebasecomicreader.Common.Common
import com.tutorial.kotlinfirebasecomicreader.Model.Comic
import com.tutorial.kotlinfirebasecomicreader.databinding.ActivityChapterBinding
class ChapterActivity : AppCompatActivity() {
private lateinit var binding: ActivityChapterBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, R.layout.activity_chapter)
binding.toolbar.title = Common.selected_comic!!.Name
binding.toolbar.setNavigationIcon(R.drawable.ic_baseline_chevron_left_24)
binding.toolbar.setNavigationOnClickListener {
finish() //GO BACK
}
binding.recyclerChapter.setHasFixedSize(true)
val layoutManager = LinearLayoutManager(this#ChapterActivity)
binding.recyclerChapter.layoutManager = layoutManager
binding.recyclerChapter.addItemDecoration(DividerItemDecoration(this, layoutManager.orientation))
fetchChapter (Common.selected_comic!!)
}
private fun fetchChapter(comic: Comic) {
Common.chapterList = comic.Chapters!!
binding.txtChapterName.text = StringBuilder("Chapter (")
.append(comic.Chapters!!.size)
.append(")")
}
}
I don't really know how to fix it and I need some help
Edited =>
activity_chapter.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<LinearLayout
android:orientation="vertical"
android:background="#android:color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ChapterActivity">
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbar"
android:minHeight="?attr/actionBarSize"
app:titleTextColor="#color/textColor"
android:background="#color/columnColor"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:orientation="horizontal"
android:padding="16dp"
android:weightSum="4"
android:background="#color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/txt_chapter_name"
android:text="Chapter (10)"
android:textColor="#color/textColor"
android:textSize="20sp"
android:textStyle="bold"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recycler_chapter"
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</layout>
Stack Trace =>
2021-03-04 11:55:23.033 11911-11911/? I/basecomicreade: Not late-enabling -Xcheck:jni (already on)
2021-03-04 11:55:23.106 11911-11911/? I/basecomicreade: Unquickening 13 vdex files!
2021-03-04 11:55:23.108 11911-11911/? W/basecomicreade: Unexpected CPU variant for X86 using defaults: x86_64
2021-03-04 11:55:23.913 11911-11911/com.tutorial.kotlinfirebasecomicreader W/ComponentDiscovery: Class com.google.firebase.dynamicloading.DynamicLoadingRegistrar is not an found.
2021-03-04 11:55:23.933 11911-11911/com.tutorial.kotlinfirebasecomicreader I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
2021-03-04 11:55:23.957 11911-11911/com.tutorial.kotlinfirebasecomicreader I/FirebaseInitProvider: FirebaseApp initialization successful
2021-03-04 11:55:24.001 11911-11932/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Unsupported class loader
2021-03-04 11:55:24.010 11911-11932/com.tutorial.kotlinfirebasecomicreader I/DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:46 and remote module com.google.android.gms.measurement.dynamite:45
2021-03-04 11:55:24.010 11911-11932/com.tutorial.kotlinfirebasecomicreader I/DynamiteModule: Selected local version of com.google.android.gms.measurement.dynamite
2021-03-04 11:55:24.053 11911-11937/com.tutorial.kotlinfirebasecomicreader D/libEGL: loaded /vendor/lib64/egl/libEGL_emulation.so
2021-03-04 11:55:24.055 11911-11937/com.tutorial.kotlinfirebasecomicreader D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
2021-03-04 11:55:24.062 11911-11937/com.tutorial.kotlinfirebasecomicreader D/libEGL: loaded /vendor/lib64/egl/libGLESv2_emulation.so
2021-03-04 11:55:24.160 11911-11911/com.tutorial.kotlinfirebasecomicreader D/skia: Warning: an opaque image should be decoded as opaque - it is being decoded as non-opaque, which will draw slower
2021-03-04 11:55:24.200 11911-11932/com.tutorial.kotlinfirebasecomicreader V/FA: onActivityCreated
2021-03-04 11:55:24.250 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: App measurement collection enabled
2021-03-04 11:55:24.254 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: App measurement enabled for app package, google app id: com.tutorial.kotlinfirebasecomicreader, 1:705167416733:android:e2429adee28166ea782374
2021-03-04 11:55:24.256 11911-11938/com.tutorial.kotlinfirebasecomicreader I/FA: App measurement initialized, version: 39000
2021-03-04 11:55:24.256 11911-11938/com.tutorial.kotlinfirebasecomicreader I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
2021-03-04 11:55:24.257 11911-11938/com.tutorial.kotlinfirebasecomicreader I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.tutorial.kotlinfirebasecomicreader
2021-03-04 11:55:24.257 11911-11938/com.tutorial.kotlinfirebasecomicreader D/FA: Debug-level message logging enabled
2021-03-04 11:55:24.287 11911-11911/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2021-03-04 11:55:24.288 11911-11911/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2021-03-04 11:55:24.354 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connecting to remote service
2021-03-04 11:55:24.420 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connection attempt already in progress
2021-03-04 11:55:24.476 11911-11935/com.tutorial.kotlinfirebasecomicreader D/HostConnection: HostConnection::get() New Host Connection established 0x7d323924d620, tid 11935
2021-03-04 11:55:24.490 11911-11935/com.tutorial.kotlinfirebasecomicreader D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
2021-03-04 11:55:24.507 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connection attempt already in progress
2021-03-04 11:55:24.509 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Activity resumed, time: 57788511
2021-03-04 11:55:24.600 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglCreateContext: 0x7d323924e840: maj 3 min 0 rcv 3
2021-03-04 11:55:24.680 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:24.690 11911-11938/com.tutorial.kotlinfirebasecomicreader I/FA: Tag Manager is not found and thus will not be used
2021-03-04 11:55:24.706 11911-11935/com.tutorial.kotlinfirebasecomicreader I/Gralloc4: mapper 4.x is not supported
2021-03-04 11:55:24.707 11911-11935/com.tutorial.kotlinfirebasecomicreader W/Gralloc3: mapper 3.x is not supported
2021-03-04 11:55:24.712 11911-11935/com.tutorial.kotlinfirebasecomicreader D/HostConnection: createUnique: call
2021-03-04 11:55:24.712 11911-11935/com.tutorial.kotlinfirebasecomicreader D/HostConnection: HostConnection::get() New Host Connection established 0x7d323924eac0, tid 11935
2021-03-04 11:55:24.713 11911-11935/com.tutorial.kotlinfirebasecomicreader D/eglCodecCommon: allocate: Ask for block of size 0x100
2021-03-04 11:55:24.713 11911-11935/com.tutorial.kotlinfirebasecomicreader D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3fe042000 size 0x2000
2021-03-04 11:55:24.716 11911-11935/com.tutorial.kotlinfirebasecomicreader D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
2021-03-04 11:55:24.730 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:24.795 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connection attempt already in progress
2021-03-04 11:55:24.797 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connection attempt already in progress
2021-03-04 11:55:25.306 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=900ms; Flags=1, IntendedVsync=57788545708266, Vsync=57788579041598, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57788595779340, AnimationStart=57788595852830, PerformTraversalsStart=57788595904150, DrawStart=57788869782150, SyncQueued=57788872423620, SyncStart=57788883887770, IssueDrawCommandsStart=57788884972440, SwapBuffers=57789368117580, FrameCompleted=57789457618760, DequeueBufferDuration=307500, QueueBufferDuration=1103560, GpuCompleted=0,
2021-03-04 11:55:25.576 11911-11938/com.tutorial.kotlinfirebasecomicreader D/FA: Connected to remote service
2021-03-04 11:55:25.577 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Processing queued up service tasks: 5
2021-03-04 11:55:27.569 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Recording user engagement, ms: 3024
2021-03-04 11:55:27.599 11911-11932/com.tutorial.kotlinfirebasecomicreader V/FA: onActivityCreated
2021-03-04 11:55:27.787 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Activity paused, time: 57791583
2021-03-04 11:55:27.924 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Activity resumed, time: 57792074
2021-03-04 11:55:27.986 11911-11946/com.tutorial.kotlinfirebasecomicreader D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-03-04 11:55:27.994 11911-11911/com.tutorial.kotlinfirebasecomicreader E/RecyclerView: No adapter attached; skipping layout
2021-03-04 11:55:28.090 11911-11946/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Verification of java.util.Set com.android.org.conscrypt.SSLUtils.getSupportedClientKeyTypes(byte[], int[]) took 100.226ms (648.53 bytecodes/s) (3304B approximate peak alloc)
2021-03-04 11:55:28.260 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:28.732 11911-11946/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Verification of boolean com.android.org.conscrypt.CertBlacklistImpl.isHex(java.lang.String) took 124.689ms (288.72 bytecodes/s) (2168B approximate peak alloc)
2021-03-04 11:55:28.836 11911-11911/com.tutorial.kotlinfirebasecomicreader I/Choreographer: Skipped 51 frames! The application may be doing too much work on its main thread.
2021-03-04 11:55:28.880 11911-11930/com.tutorial.kotlinfirebasecomicreader I/basecomicreade: Waiting for a blocking GC ProfileSaver
2021-03-04 11:55:28.887 11911-11930/com.tutorial.kotlinfirebasecomicreader I/basecomicreade: WaitForGcToComplete blocked ProfileSaver on RunEmptyCheckpoint for 7.720ms
2021-03-04 11:55:29.270 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=1239ms; Flags=0, IntendedVsync=57792137367431, Vsync=57792987367397, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57792988665860, AnimationStart=57792988801340, PerformTraversalsStart=57792989546070, DrawStart=57792989762430, SyncQueued=57792990250570, SyncStart=57792999374600, IssueDrawCommandsStart=57792999429610, SwapBuffers=57793072211200, FrameCompleted=57793385836850, DequeueBufferDuration=20442430, QueueBufferDuration=76115660, GpuCompleted=77309411328,
2021-03-04 11:55:29.691 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:29.792 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=1803ms; Flags=1, IntendedVsync=57792137367431, Vsync=57792987367397, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57792988665860, AnimationStart=57792988801340, PerformTraversalsStart=57792989546070, DrawStart=57793838734440, SyncQueued=57793840519500, SyncStart=57793843650750, IssueDrawCommandsStart=57793843800190, SwapBuffers=57793936524990, FrameCompleted=57793943762960, DequeueBufferDuration=82930, QueueBufferDuration=274660, GpuCompleted=8810055295132672,
2021-03-04 11:55:29.797 11911-11911/com.tutorial.kotlinfirebasecomicreader I/Choreographer: Skipped 57 frames! The application may be doing too much work on its main thread.
2021-03-04 11:55:29.887 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:30.096 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=1062ms; Flags=0, IntendedVsync=57792995727619, Vsync=57793945727581, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57793949431810, AnimationStart=57793949481480, PerformTraversalsStart=57793952149640, DrawStart=57793952476430, SyncQueued=57793953226090, SyncStart=57794142461760, IssueDrawCommandsStart=57794149759670, SwapBuffers=57794236027780, FrameCompleted=57794247497260, DequeueBufferDuration=296420, QueueBufferDuration=1234510, GpuCompleted=137654660947320,
2021-03-04 11:55:30.221 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:30.455 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=1270ms; Flags=0, IntendedVsync=57792995727619, Vsync=57793945727581, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57793949431810, AnimationStart=57793949481480, PerformTraversalsStart=57793952149640, DrawStart=57794142711790, SyncQueued=57794142809910, SyncStart=57794483167180, IssueDrawCommandsStart=57794483392980, SwapBuffers=57794595122060, FrameCompleted=57794606716760, DequeueBufferDuration=131380, QueueBufferDuration=409730, GpuCompleted=137657109016869,
2021-03-04 11:55:30.456 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:30.511 11911-11911/com.tutorial.kotlinfirebasecomicreader D/Slider: onImageSlideChange() called with: position = [0]
2021-03-04 11:55:30.511 11911-11911/com.tutorial.kotlinfirebasecomicreader I/SlideIndicatorsGroup: onSlideChange: 0
2021-03-04 11:55:30.515 11911-11911/com.tutorial.kotlinfirebasecomicreader I/SlideIndicatorsGroup: onSlideChange: 0
2021-03-04 11:55:30.525 11911-11911/com.tutorial.kotlinfirebasecomicreader I/Choreographer: Skipped 42 frames! The application may be doing too much work on its main thread.
2021-03-04 11:55:30.608 11911-11911/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
2021-03-04 11:55:30.608 11911-11911/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
2021-03-04 11:55:30.608 11911-11911/com.tutorial.kotlinfirebasecomicreader W/basecomicreade: Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
2021-03-04 11:55:30.718 11911-11935/com.tutorial.kotlinfirebasecomicreader D/EGL_emulation: eglMakeCurrent: 0x7d323924e840: ver 3 0 (tinfo 0x7d32392d78c0)
2021-03-04 11:55:31.073 11911-11935/com.tutorial.kotlinfirebasecomicreader I/OpenGLRenderer: Davey! duration=1118ms; Flags=1, IntendedVsync=57793962375754, Vsync=57794662375726, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=57794676994830, AnimationStart=57794677072830, PerformTraversalsStart=57794677609830, DrawStart=57794835905760, SyncQueued=57794837936740, SyncStart=57794982254730, IssueDrawCommandsStart=57794985287860, SwapBuffers=57795092878620, FrameCompleted=57795224849780, DequeueBufferDuration=215540, QueueBufferDuration=11529020, GpuCompleted=0,
2021-03-04 11:55:33.429 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Inactivity, disconnecting from the service
2021-03-04 11:55:35.432 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Recording user engagement, ms: 7288
2021-03-04 11:55:35.455 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connecting to remote service
2021-03-04 11:55:35.460 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Activity paused, time: 57799379
2021-03-04 11:55:35.589 11911-11932/com.tutorial.kotlinfirebasecomicreader V/FA: onActivityCreated
2021-03-04 11:55:35.668 11911-11911/com.tutorial.kotlinfirebasecomicreader D/AndroidRuntime: Shutting down VM
2021-03-04 11:55:35.669 11911-11911/com.tutorial.kotlinfirebasecomicreader E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.tutorial.kotlinfirebasecomicreader, PID: 11911
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tutorial.kotlinfirebasecomicreader/com.tutorial.kotlinfirebasecomicreader.ChapterActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3344)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3488)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2049)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7506)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.intern
2021-03-04 11:55:35.782 11911-11938/com.tutorial.kotlinfirebasecomicreader V/FA: Connection attempt already in progress
The documentation says that DataBindingUtil.setContentView returns:
The binding associated with the inflated content view or null if the layoutId is not a data binding layout.
So I would have to assume that your layout is not a valid data binding layout, so the issue lies in your XML.
I would recommend reading: Binding expressions which shows you the syntax of a valid binding layout and also this: Data Binding Library fully to help get a comprehensive understanding.
Also the answer by #Teo does point out the recommended way to use data binding so unless you have a specific reason for using the generic version I would switch to that.
Can try to avoid using DataBindingUtil as it keeps return null in my case.
You can try using its own databinding.inflate, as it will always get the correct binding.
binding = ActivityChapterBinding.inflate(layoutInflater)
setContentView(binding.root)
This might sound dumb, but in my case, this happened after renaming a package
and I forgot to clean the project, if databinding refuses to detect the new package name, according to this answer try to disable databinding in Build.gradle (Module), sync then re-enable it
And if you're using google-services, you'll need to adjust the naming part for the google-services.json as well.

Androis studio - APP aborting shortly after starting [duplicate]

This question already has answers here:
What is a NullPointerException, and how do I fix it?
(12 answers)
Closed 5 years ago.
I just finished a project in android studio and I have a problem here. When generating the application and installing on the smartphone (android nougat 7.1.1 oneplus3) it simply aborts. In the emulator it gives the message that the application stops and aborts. I need the help of you more experienced. I'm a beginner. Here's the LOGCAT lines below when you try to open the application:
08-16 13:51:44.610 13313-13313/agdesenvolvimentoweb.projetopiloto I/art: Not late-enabling -Xcheck:jni (already on)
08-16 13:51:44.610 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Unexpected CPU variant for X86 using defaults: x86_64
08-16 13:51:45.249 13313-13313/agdesenvolvimentoweb.projetopiloto W/System: ClassLoader referenced unknown path: /data/app/agdesenvolvimentoweb.projetopiloto-1/lib/x86_64
08-16 13:51:45.281 13313-13313/agdesenvolvimentoweb.projetopiloto I/InstantRun: starting instant run server: is main process
08-16 13:51:45.576 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
08-16 13:51:45.647 13313-13313/agdesenvolvimentoweb.projetopiloto W/System: ClassLoader referenced unknown path: /system/app/Chrome/lib/x86_64
08-16 13:51:45.648 13313-13313/agdesenvolvimentoweb.projetopiloto D/ApplicationLoaders: ignored Vulkan layer search path /system/app/Chrome/lib/x86_64:/system/app/Chrome/Chrome.apk!/lib/x86_64:/system/lib64:/vendor/lib64 for namespace 0x7fcbeb8400f0
08-16 13:51:45.650 13313-13313/agdesenvolvimentoweb.projetopiloto I/WebViewFactory: Loading com.android.chrome version 55.0.2883.91 (code 288309162)
08-16 13:51:45.670 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_LibraryLoader: Time to load native libraries: 2 ms (timestamps 9774-9776)
08-16 13:51:45.670 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_LibraryLoader: Expected native library version number "55.0.2883.91", actual native library version number "55.0.2883.91"
08-16 13:51:45.678 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_LibraryLoader: Expected native library version number "55.0.2883.91", actual native library version number "55.0.2883.91"
08-16 13:51:45.678 13313-13313/agdesenvolvimentoweb.projetopiloto I/chromium: [INFO:library_loader_hooks.cc(163)] Chromium logging enabled: level = 0, default verbosity = 0
08-16 13:51:45.683 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
[ 08-16 13:51:45.692 13313:13313 D/ ]
HostConnection::get() New Host Connection established 0x7fcbd18d6000, tid 13313
[ 08-16 13:51:45.694 13313:13313 W/ ]
Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
08-16 13:51:45.696 13313-13313/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbde5c12a0: maj 2 min 0 rcv 2
08-16 13:51:45.697 13313-13313/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbde5c12a0: ver 2 0 (tinfo 0x7fcbd18f1c20)
08-16 13:51:45.798 13313-13359/agdesenvolvimentoweb.projetopiloto W/cr_media: Requires BLUETOOTH permission
08-16 13:51:45.807 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_Ime: ImeThread is enabled.
08-16 13:51:45.885 13313-13368/agdesenvolvimentoweb.projetopiloto I/OpenGLRenderer: Initialized EGL, version 1.4
08-16 13:51:45.885 13313-13368/agdesenvolvimentoweb.projetopiloto D/OpenGLRenderer: Swap behavior 1
[ 08-16 13:51:45.885 13313:13368 D/ ]
HostConnection::get() New Host Connection established 0x7fcbcdea13c0, tid 13368
[ 08-16 13:51:45.888 13313:13368 W/ ]
Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
08-16 13:51:45.892 13313-13368/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbcdf532c0: maj 2 min 0 rcv 2
08-16 13:51:45.904 13313-13368/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf532c0: ver 2 0 (tinfo 0x7fcbcdfb3920)
08-16 13:51:45.979 13313-13374/agdesenvolvimentoweb.projetopiloto E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
[ 08-16 13:51:45.980 13313:13374 D/ ]
HostConnection::get() New Host Connection established 0x7fcbcd52f2e0, tid 13374
[ 08-16 13:51:45.982 13313:13374 W/ ]
Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
08-16 13:51:45.995 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbcdf55ca0: maj 2 min 0 rcv 2
08-16 13:51:45.998 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf55ca0: ver 2 0 (tinfo 0x7fcbcd54d900)
08-16 13:51:46.018 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
08-16 13:51:46.050 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Attempt to remove non-JNI local reference, dumping thread
08-16 13:51:46.054 13313-13368/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf532c0: ver 2 0 (tinfo 0x7fcbcdfb3920)
08-16 13:51:46.067 13313-13374/agdesenvolvimentoweb.projetopiloto I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
08-16 13:51:46.088 13313-13324/agdesenvolvimentoweb.projetopiloto W/art: Suspending all threads took: 12.371ms
08-16 13:51:46.167 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbcdf569c0: maj 2 min 0 rcv 2
08-16 13:51:46.169 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf569c0: ver 2 0 (tinfo 0x7fcbcd54d900)
08-16 13:51:46.175 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
08-16 13:51:46.176 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
08-16 13:51:46.176 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
08-16 13:51:46.176 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
08-16 13:51:46.180 13313-13374/agdesenvolvimentoweb.projetopiloto E/libEGL: called unimplemented OpenGL ES API
08-16 13:51:46.707 13313-13313/agdesenvolvimentoweb.projetopiloto W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 13313
08-16 13:51:46.709 13313-13313/agdesenvolvimentoweb.projetopiloto I/Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.
08-16 13:51:46.716 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Attempt to remove non-JNI local reference, dumping thread
08-16 13:51:46.752 13313-13313/agdesenvolvimentoweb.projetopiloto E/chromium: [ERROR:interface_registry.cc(104)] Failed to locate a binder for interface: autofill::mojom::PasswordManagerDriver
08-16 13:51:46.753 13313-13313/agdesenvolvimentoweb.projetopiloto D/AndroidRuntime: Shutting down VM
--------- beginning of crash
08-16 13:51:46.753 13313-13313/agdesenvolvimentoweb.projetopiloto E/AndroidRuntime: FATAL EXCEPTION: main
Process: agdesenvolvimentoweb.projetopiloto, PID: 13313
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ProgressDialog.dismiss()' on a null object reference
at agdesenvolvimentoweb.projetopiloto.MainActivity$MyWebViewClient.onPageFinished(MainActivity.java:161)
at com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:545)
at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:201)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Your setting dismiss() on your progress bar somewhere in your code with out having initialised it.
do
if(progress!= null)
progress.dismiss()
First, put only your application's log.
Second, you are trying to dismiss a progress dialog when its not initialized.
java.lang.NullPointerException: Attempt to invoke virtual
method 'void android.app.ProgressDialog.dismiss()' on a null object reference
I'd start my inspections with MainActivity.java:161

IntentService started twice

I have used IntentSerivce to download a large json. I have used Gson and Retrofit2 in the first place. After I have found that Jackson is better for marshaling of large json.
And here problem starts, intentService has been triggered twice even in code is called only once.
I am triggering intentService from splash screen, the orientation of the device is landscape. There are no flipping up/down so I guess that there is no recreation of activity when orientation is changed. Also app is hardcoded to start in landscape orientation.
Here are logs from logCat
I/APPLICATION CLASS: DB FOUND
02-28 10:15:25.034 1561-2108/? I/ActivityManager: START u0 {flg=0x10000000 cmp=aoc.netcast.rs.android_ott_client/.view.SplashScreen} from uid 10073 on display 0
02-28 10:15:25.040 3195-3195/? I/INTENT PERFORMING: Starting intent...
02-28 10:15:25.041 3195-3195/? I/INTENT PERFORMING: Intent started...
02-28 10:15:25.053 1206-1286/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
02-28 10:15:25.062 3195-3210/? W/nAnnotationIntrospector: Unable to load JDK7 annotation types; will have to skip
02-28 10:15:25.074 3195-3195/? I/INTENT PERFORMING: Starting intent...
02-28 10:15:25.074 3195-3195/? I/INTENT PERFORMING: Intent started...
02-28 10:15:25.090 3195-3210/? W/System.err: WARNING: could not load Java7 Path class
02-28 10:15:25.330 1206-1206/? E/SurfaceFlinger: rejecting buffer: bufWidth=1080, bufHeight=1920, front.active.{w=1080, h=1776}
[ 02-28 10:15:25.341 3195: 3209 D/ ]
HostConnection::get() New Host Connection established 0x7fa7db557360, tid 3209
02-28 10:15:25.344 3195-3209/? I/OpenGLRenderer: Initialized EGL, version 1.4
02-28 10:15:25.344 1561-1612/? I/InputReader: Reconfiguring input devices. changes=0x00000004
02-28 10:15:25.344 1561-1612/? I/InputReader: Device reconfigured: id=0, name='qwerty2', size 1080x1920, orientation 1, mode 1, display id 0
02-28 10:15:25.350 1694-2096/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7fa7cf1b1b10
02-28 10:15:25.353 1694-2096/? E/EGL_emulation: tid 2096: eglSurfaceAttrib(1165): error 0x3009 (EGL_BAD_MATCH)
02-28 10:15:25.353 1694-2096/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fa7ce77fa80, error=EGL_BAD_MATCH
02-28 10:15:25.365 3195-3209/? E/EGL_emulation: tid 3209: eglSurfaceAttrib(1165): error 0x3009 (EGL_BAD_MATCH)
02-28 10:15:25.365 3195-3209/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fa7db548c40, error=EGL_BAD_MATCH
02-28 10:15:25.367 1694-2096/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7fa7cf1b23d0
02-28 10:15:25.378 1694-2096/? E/EGL_emulation: tid 2096: eglSurfaceAttrib(1165): error 0x3009 (EGL_BAD_MATCH)
02-28 10:15:25.378 1694-2096/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fa7ce77fac0, error=EGL_BAD_MATCH
02-28 10:15:25.449 1561-1580/? I/ActivityManager: Displayed aoc.netcast.rs.android_ott_client/.view.SplashScreen: +390ms (total +578ms)
02-28 10:15:25.458 1561-1580/? I/WindowManager: Screen frozen for +559ms due to Window{85b86c9 u0 aoc.netcast.rs.android_ott_client/aoc.netcast.rs.android_ott_client.view.SplashScreen}
02-28 10:15:27.461 1561-1580/? I/art: Starting a blocking GC Explicit
02-28 10:15:27.471 1561-1580/? I/art: Explicit concurrent mark sweep GC freed 14571(904KB) AllocSpace objects, 3(60KB) LOS objects, 31% free, 8MB/12MB, paused 127us total 9.460ms
02-28 10:15:30.335 1561-2989/? I/AccountManagerService: getTypesVisibleToCaller: isPermitted? true
I don't know why is this happening, can you please help me to solve this?

Genymotion: "Unfortunately <app> has stopped"

I've created an application in React Native that works fine in iOS. I've copied the code over to the Android portion of it, and separated out the platform-specific components. When I hit a certain component, the app crashes with an "Unfortunately has stopped".
There are no logs, no error in the console, nothing. What do I look for and where can I look? Logs? Somewhere in code?
In ~/genymotion-log/Google Nexus 6<...>-logcat.txt, I see the following:
05-15 23:50:14.379 D/OpenGLRenderer( 620): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
05-15 23:50:14.380 D/Atlas ( 620): Validating map...
05-15 23:50:14.429 I/OpenGLRenderer( 620): Initialized EGL, version 1.4
05-15 23:50:14.429 D/ ( 620): HostConnection::get() New Host Connection established 0xaf31ca40, tid 1876
05-15 23:50:14.463 D/OpenGLRenderer( 620): Enabling debug mode 0
05-15 23:50:14.489 W/EGL_emulation( 620): eglSurfaceAttrib not implemented
05-15 23:50:14.490 W/OpenGLRenderer( 620): Failed to set EGL_SWAP_BEHAVIOR on surface 0x9e45dfc0, error=EGL_SUCCESS
05-15 23:50:14.490 W/EGL_emulation( 941): eglSurfaceAttrib not implemented
05-15 23:50:14.490 W/OpenGLRenderer( 941): Failed to set EGL_SWAP_BEHAVIOR on surface 0xb43e44a0, error=EGL_SUCCESS
05-15 23:50:14.952 I/ActivityManager( 620): Killing 1492:com.android.onetimeinitializer/u0a10 (adj 15): empty #17
05-15 23:50:15.219 W/OpenGLRenderer( 941): Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
05-15 23:50:15.440 W/ResourceType( 724): No package identifier when getting value for resource number 0x00000000
05-15 23:50:15.442 W/PackageManager( 724): Failure retrieving resources for com.bidsmart: Resource ID #0x0
05-15 23:50:18.400 W/AudioTrack( 620): AUDIO_OUTPUT_FLAG_FAST denied by client
05-15 23:50:18.424 I/Process ( 1805): Sending signal. PID: 1805 SIG: 9
05-15 23:50:18.463 D/OpenGLRenderer( 620): endAllStagingAnimators on 0xa1a6f780 (RippleDrawable) with handle 0xaf3be470
05-15 23:50:18.468 I/ActivityManager( 620): Process com.bidsmart (pid 1805) has died
05-15 23:50:18.472 W/InputMethodManagerService( 620): Got RemoteException sending setActive(false) notification to pid 1805 uid 10061
No fix, but the reason is I'm pushing too much data from the server to the client. Once I ran adb logcat, I got this:
java.lang.OutOfMemoryError: Failed to allocate a 2470012 byte allocation with 48508 free bytes and 47KB until OOM.
Turns out I'm pushing my images over and over to the client until it breaks. iOS can handle it but RN can't.
Link to StackOverflow related thread: Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free bytes and 2MB until OOM

Categories

Resources