Android Studio Loading Texture error - java

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.

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)

Exoplayer video support crashing the app in release build

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.** { *; }

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?

getResources returns null

We register a broadcast receiver to receive package installment or uninstallment event.
But some users report crash reports like this:
java.lang.RuntimeException: Unable to create application com.kc.security.MoSecurityApplication: java.lang.RuntimeException: getResources is null: dir - /data/app/com.cm.mg-1.apk, srcVal-1, srcVal-2
at android.app.LoadedApk.makeApplication(LoadedApk.java:495)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2249)
at android.app.ActivityThread.access$1600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: getResources is null: dir - /data/app/com.cm.mg-1.apk, srcVal-1, srcVal-2
at com.kc.security.b.ab.b(UpdateManager.java:69)
at com.kc.security.b.ab.a(UpdateManager.java:112)
at com.kc.security.MoSecurityApplication.onCreate(MoSecurityApplication.java:66)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
at android.app.LoadedApk.makeApplication(LoadedApk.java:492)
... 11 more
It is not easy to reappear this crash. We think a lot about this problem. We receive a
uninstall event ,then the Application context Class called it's onCreate method, we do
some initial works there , when we call getResouce(), it returns null . When look deep
inside the framework codes, we find that getReource locate resources file by sourceDir
String in ApplicationInfo, and the String is "/data/app/com.cm.mg-1.apk" > it's the original apk , and it is not exists anymore.
It maybe happens when user update our application. In some way "/data/app/com.cm.mg-1.apk" is allready deleted and replace by "/data/app/com.cm.mg-2.apk" any way, but the "sourceDir" String in ApplicationInfo is not update.
I want to know what android does when doing a updating.
Encountered a similar problem, check this out.
RuntimeException: Unable to instantiate application
I think this should answer this question, maybe because the Resources has been destroyed during this uninstall event.

How do I find this RuntimeException in Android (stack trace)?

I have this strack trace from the Developer Console on Google Play so I have no way to reproduce this exception cause I don't know what triggers it. The user also didn't leave any message, so...
java.lang.RuntimeException: Binary XML file line #17: You must supply a layout_height attribute.
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)
at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5319)
at android.view.ViewGroup$LayoutParams.<init>(ViewGroup.java:5271)
at android.widget.AbsListView$LayoutParams.<init>(AbsListView.java:6398)
at android.widget.AbsListView.generateLayoutParams(AbsListView.java:6035)
at android.widget.AbsListView.generateLayoutParams(AbsListView.java:96)
at android.view.LayoutInflater.inflate(LayoutInflater.java:477)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at com.android.internal.view.menu.ListMenuPresenter$MenuAdapter.getView(ListMenuPresenter.java:253)
at android.widget.AbsListView.obtainView(AbsListView.java:2212)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1244)
at android.widget.ListView.onMeasure(ListView.java:1155)
at android.view.View.measure(View.java:12863)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2256)
at android.view.View.measure(View.java:12863)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1166)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2552)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4507)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
How do I pinpoint the problem?
This is Android's internal error, nothing in your code. You don't even see your app's code in stack trace, and your app works on many other devices.
I'm getting similar occasional crash reports, and also similar crashes on some Android versions (using ACRA). I've seen "You must supply a layout_height attribute" unexpected crash a few times.
If you use ACRA or similar, sometimes you just get reports for which your app is not responsible at all.
Message says - "You must supply a layout_height attribute."
So, double check that all your components have layout_height attribute.
I also had mention "menu" in this stack. It is generated by system. Double check that your all menus have valid items (at least not zero items) all the time.

Categories