JNI WArning :Method called with exception pending - java

I have built the app i release mode using proguard.and I am getting this error.
01-20 15:16:37.611: W/dalvikvm(31760): JNI WARNING: JNI method called with exception pending
01-20 15:16:37.611: W/dalvikvm(31760): Pending exception is:
01-20 15:16:37.616: W/System.err(31760): java.lang.RuntimeException: Stub
When i build apk in normal way it works on my device but following release mode it does not work.

The documentation states
You must not call most JNI functions while an exception is pending. Your code is expected to notice the exception (via the function's return value, ExceptionCheck, or ExceptionOccurred) and return, or clear the exception and handle it.
You need to add error checking in your code.

Related

android api 30 Fatal signal 6 (SIGABRT)

My app worked fine at api29. Now getting this native error. No clue otherwise.
D/TransportRuntime.SQLiteEventStore: Storing event with priority=DEFAULT, name=FIREPERF for destination cct
V/FA: Connection attempt already in progress
V/FA: Connection attempt already in progress
D/TransportRuntime.JobInfoScheduler: Scheduling upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy1wYS5nb29nbGVhcGlzLmNvbS92MS9maXJlbG9nL2xlZ2FjeS9iYXRjaGxvZ1xBSXphU3lDY2traUg4aTJaQVJ3T3MxTEV6RktsZDE1YU9HOG96S28=) with jobId=-546033166 in 30000ms(Backend next call timestamp 1639520060629). Attempt 1
D/mainact: buildDisplayDataBase:
A/libc: fdsan: attempted to close file descriptor 75, expected to be unowned, actually owned by FILE* 0xf108246c
Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20661 (eymoreau.fitlog), pid 20661 (eymoreau.fitlog)
Disconnected from the target VM, address: 'localhost:60917', transport: 'socket'
If you are displaying images try eliminating them to see of it fixes the error.
It did for me and I ended up changing my image loading from:
mainMenu_viewHolder.getImageView().setImageResource(R.drawable.gear);
to...
Bitmap checkImg = BitmapFactory.decodeResource(fragment.getResources(), R.drawable.check);
mainMenu_viewHolder.getImageView().setImageBitmap(checkImg);
The issue is buried very deep so if this doesn't work for you don't try stepping through your code or researching the native error. It will be wasted time. Just disable your fragments entire view structure and add back in piece by piece.

Channel ManagedChannelImpl{logId=1, target=photoslibrary.googleapis.com:443} was not shutdown properly

Has anyone experienced this error with Google Photos SDK for Java:
SEVERE: *~*~*~ Channel ManagedChannelImpl{logId=1, target=photoslibrary.googleapis.com:443} was not shutdown properly!!! ~*~*~*
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
java.lang.RuntimeException: ManagedChannel allocation site
at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(ManagedChannelOrphanWrapper.java:94)
at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:52)
at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:43)
at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:514)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:223)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:164)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:156)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:157)
at com.google.photos.library.v1.internal.stub.GrpcPhotosLibraryStub.create(GrpcPhotosLibraryStub.java:286)
at com.google.photos.library.v1.internal.stub.PhotosLibraryStubSettings.createStub(PhotosLibraryStubSettings.java:264)
at com.google.photos.library.v1.internal.InternalPhotosLibraryClient.<init>(InternalPhotosLibraryClient.java:180)
at com.google.photos.library.v1.PhotosLibraryClient.<init>(PhotosLibraryClient.java:101)
at com.google.photos.library.v1.PhotosLibraryClient.initialize(PhotosLibraryClient.java:114)
What's the workaround for this?

build failed because of "org.gradle.tooling.BuildException: invalid code lengths set"

This error occurs whenever I try to run the app or make an apk, and I don't remember making any significant changes before this issue appeared
here are the details
FAILURE: Build failed with an exception.
Caused by: org.gradle.tooling.BuildException: invalid block type
at com.android.build.gradle.internal.scope.BuildElements$ExecutorBasedScheduler$transform$2.invoke(BuildElements.kt:133)
at com.android.build.gradle.internal.scope.BuildElements$ExecutorBasedScheduler$transform$2.invoke(BuildElements.kt:110)
at kotlin.sequences.SequencesKt___SequencesKt$onEach$1.invoke(_Sequences.kt:1260)
at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:149)
at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:109)
at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:133)
at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:153)
at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:633)
at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:663)
at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:654)
at com.android.build.gradle.internal.scope.BuildElements$ExecutorBasedScheduler.transform(BuildElements.kt:140)
at com.android.build.gradle.internal.scope.BuildElements$ExecutorBasedScheduler.into(BuildElements.kt:115)
at com.android.build.gradle.internal.scope.BuildElementActionScheduler.into(BuildElementActionScheduler.kt:32)
at com.android.build.gradle.tasks.PackageAndroidArtifact.doFullTaskAction(PackageAndroidArtifact.java:401)
There is a lot more to add, the error detail is over 35000 characters, but this website doesn't allow me to add all that.
I'll respond soon to any things that you might want to know
Here are the complete details of the error https://drive.google.com/file/d/1v5xZkWXORuzAUVhOl_NY2b_kBZILKrT9/view?usp=sharing

Why does android logcat not show the stack trace for a runtime exception?

An android application that I am currently developing was crashing (fixed that), due to what should have raised an IndexOutOfBoundsException. I was accessing a string in the doInBackground method of a class that extends AyncTask, from the variable arguments parameter (ie String...). I was accidentally accessing index 1 (not 0) of a one element variable argument string (mildly embarrassing...). When the application first crashed I looked at my logcat, (and many times again to confirm that I wasn't insane) and there was no stack trace for a RuntimeException to be found. I crash my phone quite often and there is always a nice little stack trace for me to look at and fix with, but I was puzzled by this. Here is the pertinent section of my logcat (which contains no stack trace for a runtimeexception), following a debug statement right before the line of code that was causing the crash:
W/dalvikvm(25643): threadid=11: thread exiting with uncaught exception (group=0x40c281f8)
D/dalvikvm(25643): GC_CONCURRENT freed 1249K, 25% free 12433K/16455K, paused 2ms+6ms
W/dalvikvm(25643): threadid=15: thread exiting with uncaught exception (group=0x40c281f8)
I/Process (25643): Sending signal. PID: 25643 SIG: 9
I/ActivityManager( 5905): Process com.trade.nav.ges (pid 25643) has died.
W/ActivityManager( 5905): Force removing r: app died, no saved state
I/WindowManager( 5905): WIN DEATH: win
I/WindowManager( 5905): WIN DEATH: win
I/SurfaceFlinger( 1746): id=3848 Removed idx=2 Map Size=4
I/SurfaceFlinger( 1746): id=3848 Removed idx=-2 Map Size=4
I/WindowManager( 5905): WIN DEATH: win
I/power ( 5905): *** acquire_dvfs_lock : lockType : 1 freq : 1000000
D/PowerManagerService( 5905): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT frequency : 1000000 uid : 1000 pid : 5905 tag : ActivityManager
W/ActivityManager( 5905): mDVFSLock.acquire()
And after that, another activity starts.
For reference, here is the code that caused the crash:
private class LoadImage extends AsyncTask<String, Integer, Bitmap> {
String url = "";
//...
public LoadImage(ImageView iv, Context c) {
//...
}
protected Bitmap doInBackground(String... urls) {
// urls has one element
url = urls[1];
//...
}
//...
}
Any insight into what is happening would please me greatly, as I am curious about having never seen anything like this on the internet.
Thanks.
Edit: I have no filter set
Your threads are clearly crashing (note the thread exiting with uncaught exception on two different threads in the same process). The process is cleaning up after itself -- Sending signal indicates the process is sending a fatal signal to itself. So the question is why you aren't seeing a stack dump between these two.
The stack dump comes from RuntimeInit$UncaughtHandler, which is the framework-provided global uncaught exception handler. The process self-annihilation happens in the finally block. It's hard to see a way to get out of this without logging "FATAL EXCEPTION", unless something in Slog.e fails and throws.
I would guess that either something is failing in Slog.e, or somebody has replaced the framework's uncaught exception handler. The latter could happen if you've incorporated some external library into your app, such as a crash log catcher or an ad network, and the new handler doesn't log the exception but does kill the process.
You can track it down by attaching a Java-language debugger (e.g. Eclipse). By default it will stop on uncaught exceptions. From there you can trace it around, set breakpoints and single-step through the uncaught exception handler (if you have full sources), and so on.
As per fadden's suspect that external library could override uncaught exception handler, I started to investigate any possible libs. Turned out that GoogleAnalytics throttles crashes and prevents the stack trace from being displayed in logcat if you turn on enableExceptionReporting. I remove this line of code then everything gets back on track!! That could be the first time I was so happy to see crashes!!

An exception is encountered java.lang.UNIXProcess.forkAndExec

Anyone knows what is the reason for encountering this exception?
An exception is encountered during the processing. The stack track is below:
java.lang.UNIXProcess.forkAndExec(Native Method)
java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
java.lang.ProcessImpl.start(ProcessImpl.java:65)
java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
java.lang.Runtime.exec(Runtime.java:591)
java.lang.Runtime.exec(Runtime.java:464)
....
org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:198)
org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
org.quartz.core.JobRunShell.run(JobRunShell.java:202)
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
If the exception is being thrown from the start() method, then the OS isn't able to fork/exec the process. So the problem isn't the subprocess dying, but that it's not being launched.
So are you specifying this correctly ? Are you relying on PATH settings ? Are the execute permissions correct ?
It would be useful to see the code that you use to initialise the ProcessBuilder. i.e. the invocation parameters.

Categories

Resources