Exoplayer video support crashing the app in release build - java

This crash occurs in playing the mp4 stream. Exoplayer version 12.2.0 . Android Run in debug mode - everything is fine. Run in release mode - app crashes
Fatal Exception: java.lang.AbstractMethodError: abstract method "java.lang.Object com.google.a.a.c.a(java.lang.Object)"
--------- beginning of crash
2021-02-10 12:52:49.385 4549-4645/? E/AndroidRuntime: FATAL EXCEPTION: ExoPlayer:Playback
Process: app.baff, PID: 4549
java.lang.AbstractMethodError: abstract method "void com.google.android.exoplr2avp.extractor.TrackOutput.sampleData(com.google.android.exoplr2avp.util.ParsableByteArray, int)"
at com.google.android.exoplr2avp.extractor.mp4.Mp4Extractor.readSample(Mp4Extractor.java:536)
at com.google.android.exoplr2avp.extractor.mp4.Mp4Extractor.read(Mp4Extractor.java:200)
at com.google.android.exoplr2avp.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
at com.google.android.exoplr2avp.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1046)
at com.google.android.exoplr2avp.upstream.Loader$LoadTask.run(Loader.java:415)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
2021-02-10 12:52:49.385 4549-4649/? E/AndroidRuntime: FATAL EXCEPTION: Loader:ProgressiveMediaPeriod
Process: app.baff, PID: 4549
java.lang.AbstractMethodError: abstract method "void com.google.android.exoplr2avp.extractor.TrackOutput.sampleData(com.google.android.exoplr2avp.util.ParsableByteArray, int)"
at com.google.android.exoplr2avp.extractor.mp4.Mp4Extractor.readSample(Mp4Extractor.java:536)
at com.google.android.exoplr2avp.extractor.mp4.Mp4Extractor.read(Mp4Extractor.java:200)
at com.google.android.exoplr2avp.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
at com.google.android.exoplr2avp.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1046)
at com.google.android.exoplr2avp.upstream.Loader$LoadTask.run(Loader.java:415)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

Add this line in the proguard config file fixes the issue for me.
-keepnames class com.google.common.** { *; }
Visit
google/guava#322 for more resources.

https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/580
android.enableDexingArtifactTransform=false
-keepnames class com.google.common.** { *; }

Related

When I copy file on android 31 throw IllegalStateException

I need to rerecord video and copy to my Private Storage but when I copy file throw IllegalStateException
What is the solution here?
This video shows how the crash occurs
E/AndroidRuntime: FATAL EXCEPTION: pool-25-thread-1
Process: com.majd.paraibachat, PID: 13789
java.lang.IllegalStateException: Only owner is able to interact with pending item content://media/external_primary/video/media/150
at android.os.Parcel.createExceptionOrNull(Parcel.java:2433)
at android.os.Parcel.createException(Parcel.java:2409)
at android.os.Parcel.readException(Parcel.java:2392)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:153)
at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:780)
at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:2027)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1842)
at android.content.ContentResolver.openInputStream(ContentResolver.java:1518)
at com.majd.paraibachat.persistance.FileBackend.copyFileToPrivateStorage(FileBackend.java:716)
at com.majd.paraibachat.persistance.FileBackend.copyFileToPrivateStorage(FileBackend.java:917)
at com.majd.paraibachat.services.AttachFileToConversationRunnable.processAsFile(AttachFileToConversationRunnable.java:71)
at com.majd.paraibachat.services.AttachFileToConversationRunnable.run(AttachFileToConversationRunnable.java:176)
at com.majd.paraibachat.utils.SerialSingleThreadExecutor$Runner.run(SerialSingleThreadExecutor.java:60)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)

Android app crashes when minifyEnabled is true

I am using a multi-module app and the app crashes when minifyEnabled true in the installed module's build.gradle.
Following is the deobfuscated stacktrace I retrieved from play console.
FATAL EXCEPTION: ControllerMessenger
Process: com.packagename, PID: 16978
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference
at com.packagename.login.Utils.AuthenticationActions.saveCredentials(AuthenticationActions.java)
at com.packagename.login.LoginActivity$1$1.onCompleted(LoginActivity.java)
at com.packagename.login.LoginActivity$1$1.onCompleted(LoginActivity.java)
at com.koushikdutta.async.future.SimpleFuture.handleCallbackUnlocked(SimpleFuture.java)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java)
at com.koushikdutta.ion.IonRequestBuilder$EmitterTransform$1.onCompleted(IonRequestBuilder.java)
at com.koushikdutta.async.future.SimpleFuture.handleCallbackUnlocked(SimpleFuture.java)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java)
at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java)
at com.koushikdutta.ion.IonRequestBuilder$1.run(IonRequestBuilder.java)
at com.koushikdutta.async.AsyncServer$RunnableWrapper.run(AsyncServer.java)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at androidx.test.espresso.base.Interrogator.a(Interrogator.java:19)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:166)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:158)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:34)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:77)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:52)
at androidx.test.espresso.action.Tap.c(Tap.java:8)
at androidx.test.espresso.action.Tap.b(Tap.java:18)
at androidx.test.espresso.action.Tap$1.a(Tap.java:3)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:22)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:9)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:79)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:96)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:3)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5459)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
I am unable to understand what does this code correspond to 'java.lang.Object java.util.List.get(int)'
I am using multiple external libraries, one of which is ion koush.
I have tried adding this to ever proguard-rules.pro file in my project
-keep class com.koushikdutta.** { *;}. But this didn't yield any success.
This happens when your app transform json to POJOs and you have minify enable. Minify change those POJOs making the transformation impossible (it will compile, but all your POJOs propierties will be null).
Keep those POJOs adding -keep class com.packagename.<path to pojos> {*; } to your proguard-rules file.
Also add "#Keep" above class name to all Pojo files.

Fatal Exception: java.lang.SecurityException: Setting enable_navbar is not accessible from ephemeral package

From Fabric Crashlytic, I observe this crash happening (on Android 8.0 and Huawei devices)
Fatal Exception: java.lang.SecurityException: Setting enable_navbar is not accessible from ephemeral package mypacakge.com
at android.os.Parcel.readException(Parcel.java:1945)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.call(ContentProviderNative.java:651)
at android.provider.Settings$NameValueCache.getStringForUser(Settings.java:1954)
at android.provider.Settings$System.getStringForUser(Settings.java:2275)
at android.provider.Settings$System.getIntForUser(Settings.java:2353)
at android.provider.Settings$System.getInt(Settings.java:2348)
at android.view.HwViewRootImpl.isNaviEnable(HwViewRootImpl.java:242)
at android.view.HwViewRootImpl.filterDecorPointerEvent(HwViewRootImpl.java:108)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5201)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5012)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4526)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4579)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4545)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4672)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4553)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4729)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4526)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4579)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4545)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4553)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4526)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7101)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7075)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7036)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7257)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:192)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:379)
at android.os.Looper.loop(Looper.java:144)
at android.app.ActivityThread.main(ActivityThread.java:7406)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:926)
Doesn't seems to be our code. Anyone has any idea what causes this? How could I replicate the issue, workaround or even fix it?

Android Studio Weather Application Crashing

So, I have been following a YouTube tutorial for an android Weather application. The app seems to compile, however crashes whenever opened on the emulator. I'm not the most fluent programmer, however the code is understood. I can't figure out what's causing the issue though. The app is supposed to fetch weather data for the location of the hardcoded location in "MainActivity.java". The data is fetched from Yahoo! using an API.
Link for the project files: https://drive.google.com/drive/folders/0B2dQ9-JQjysVeXlqZENBZDExN0E?usp=sharing
Below is the error I get:
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.mattbenson.cw_2_weather, PID: 2529
java.lang.NullPointerException: Attempt to invoke virtual method 'int org.json.JSONObject.optInt(java.lang.String)' on a null object reference
at com.example.mattbenson.cw_2_weather.service.WeatherService$1.onPostExecute(WeatherService.java:81)
at com.example.mattbenson.cw_2_weather.service.WeatherService$1.onPostExecute(WeatherService.java:38)
at android.os.AsyncTask.finish(AsyncTask.java:667)
at android.os.AsyncTask.-wrap1(AsyncTask.java)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:684)
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)
E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -19
E/EGL_emulation: tid 2570: swapBuffers(487): error 0x300d (EGL_BAD_SURFACE)
W/OpenGLRenderer: swapBuffers encountered EGL error 12301 on 0x76990bb1c580, halting rendering...
Application terminated.
(Sorry, I am new to this site!)
Any help is greatly appreciated.
As StackTrace says the error is at Class WeatherService at line 81 int count = queryResults.optInt("Count"); because it is returning NULL.
Try using method optInt with fallback value queryResults.optInt("Count", 0);

Android Studio Loading Texture error

I have this strange error where I can't load any textures anymore. The assets that I used are fine, but when I try to add new assets, it throws me this:
E/AndroidRuntime: FATAL EXCEPTION: GLThread 9855
Process: com.NeverMind.MainClass.android, PID: 18482
com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: bg.png
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92)
at com.NeverMind.DontFall.android.MainClass.create(MainClass.java:200)
at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:241)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1520)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)
Caused by: java.io.IOException: Error loading pixmap: decoder init failed for stream
at com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.<init>(Gdx2DPixmap.java:57)
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:138)
at com.badlogic.gdx.graphics.TextureData$Factory.loadFromFile(TextureData.java:98) 
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100) 
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92) 
at com.NeverMind.DontFall.android.MainClass.create(MainClass.java:200) 
at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:241) 
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1520) 
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248) 
I didn't do anything stupid. I also tried to trick him and put the new texture with the name of an old one and it didn't work. This is the first time this happens, I have thousands of lines in the code.
The problem was with the bit depth. It needs to be smaller.

Categories