I have a react native app where i have integrated OKTA using this library and all seems to work good but when i tried to log out i call below method and it crash with the below exception :-
let config = createConfigOktaObject(
configObject.OktaDomain, configObject.ClientId, );
createConfig(config);
signOut(); <-- library function
Exception :-
AndroidRuntime: java.lang.RuntimeException: Failure delivering result
ResultInfo{who=null, request=1994471877, result=-1, data=Intent {
act=com.okta.oidc.OktaRedirectActivity.REDIRECT_ACTION dat=com.okta.infinitycloud:?
state=NfirEe5k7ZKf5b3iYGjHgA flg=0x34400000
cmp=com.oktademo/com.okta.oidc.OktaAuthenticationActivity }} to activity
{com.oktademo/com.oktademo.MainActivity}: java.lang.UnsupportedOperationException:
This isn't a hierarchical URI.01-12 01:20:09.442 7638 7638 E AndroidRuntime: at
android.app.ActivityThread.deliverResults(ActivityThread.java:5340)01-12 01:20:09.442
7638 7638 E AndroidRuntime: at
android.app.ActivityThread.handleSendResult(ActivityThread.java:5379)01-12
01:20:09.442 7638 7638 E AndroidRuntime: at
Related
How do I fix this issue?
Fatal Exception: java.lang.RuntimeException: Failure delivering result
ResultInfo{who=null, request=1, result=0, data=Intent { (has extras)
}} to activity {packagedName/packagedName.MainActivity}:
java.lang.IllegalStateException: Reply already submitted
packagedName is my project package name
I guess you're developing your own plugin for Native Platforms.
The problem is that you can not call "result.success()" or "result.error()" more then once using the same MethodChannel.Result object.
I have one device that throws an exception when I try to run unit tests on a project recently converted to use the androidX support libraries. The tests have run on emulators and other physical devices.
The device it will not run on is a Pixel 2 running 9.
App crashes with this exception:
AndroidRuntime: FATAL EXCEPTION: main
AndroidRuntime: PID: 7050
AndroidRuntime: java.lang.IllegalStateException: Call to getContentProviderExternal for: android_support_test_services.speak_easy returns null!
AndroidRuntime: at androidx.test.services.speakeasy.client.ToolConnection$ToolConnectionPostIcs.doCall(ToolConnection.java:155)
AndroidRuntime: at androidx.test.services.speakeasy.client.ToolConnection.publish(ToolConnection.java:93)
AndroidRuntime: at androidx.test.services.speakeasy.client.ToolConnection.publish(ToolConnection.java:83)
AndroidRuntime: at androidx.test.services.shellexecutor.BlockingPublish.getResult(BlockingPublish.java:79)
AndroidRuntime: at androidx.test.services.shellexecutor.ShellCommandExecutorServer.start(ShellCommandExecutorServer.java:80)
AndroidRuntime: at androidx.test.services.shellexecutor.ShellMain.main(ShellMain.java:45)
AndroidRuntime: at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
AndroidRuntime: at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:340)
AndroidRuntime: Error reporting crash
AndroidRuntime: java.lang.RuntimeException: Bad file descriptor
AndroidRuntime: at android.os.BinderProxy.transactNative(Native Method)
AndroidRuntime: at android.os.BinderProxy.transact(Binder.java:1127)
AndroidRuntime: at android.app.IActivityManager$Stub$Proxy.handleApplicationCrash(IActivityManager.java:3711)
AndroidRuntime: at com.android.internal.os.RuntimeInit$KillApplicationHandler.uncaughtException(RuntimeInit.java:143)
AndroidRuntime: at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
AndroidRuntime: at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
AndroidRuntime: at java.lang.Thread.dispatchUncaughtException(Thread.java:1955)
Simplified Unit Test:
import androidx.test.rule.ActivityTestRule
import org.junit.Assert
import org.junit.Rule
import org.junit.Test
class MyTest {
#Rule
var activityTestRule: ActivityTestRule<AuthAppActivity> = object : ActivityTestRule<AuthAppActivity>(AuthAppActivity::class.java, false, false) {
override fun afterActivityLaunched() {
}
override fun beforeActivityLaunched() {
}
}
#Test
fun runTest() {
Assert.assertTrue(true); // low standards here
}
}
And the relevant dependencies:
testImplementation('junit:junit:4.12') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
testImplementation 'org.hamcrest:hamcrest-library:1.3'
androidTestImplementation "androidx.annotation:annotation:1.0.0"
androidTestImplementation "androidx.test:runner:1.1.0"
androidTestImplementation "androidx.test:rules:1.1.0"
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation "androidx.test.espresso:espresso-core:3.1.0"
androidTestImplementation "androidx.test.espresso:espresso-idling-resource:3.1.0"
androidTestImplementation "androidx.test.espresso:espresso-contrib:3.1.0"
androidTestImplementation "androidx.test.espresso:espresso-web:3.1.0"
androidTestImplementation "androidx.test.espresso:espresso-intents:3.1.0"
The provider android_support_test_services.speak_easy is obviously missing from the device. I ran the test on the working device and see that the same provider is used and found on that device. I pulled up an older branch, prior to AndroidX, ran the a instrumented test from there and then switched back, the error was gone.
Older version installed these versions:
test-services-1.0.2.apk
orchestrator-1.0.2.apk
Newer androidx:
orchestrator-1.1.0-alpha3.apk
test-services-1.1.0-alpha3.apk
I finally fixed this after realizing I was using an old version of Test Orchestrator link I was accidentally depending on the old android.support.test version, not the androidx.test version, even though I'd updated all the other test packages to androidx.test.
I am updating com.google.android.gms and firebase gradle dependencies to fix the error described here: Unable to start receiver com.google.firebase.iid.FirebaseInstanceIdInternalReceiver. I was using
compile 'com.google.android.gms:play-services:9.8.0'. Using versions above that seems to cause the following stack trace during adb logcat.
Why is this error caused?
FATAL EXCEPTION: main
05-15 12:21:11.721 11491 11491 E AndroidRuntime: Process: com.netbeast.yeti.debug,
PID: 11491 05-15 12:21:11.721 11491 11491 E AndroidRuntime:
java.lang.RuntimeException: Unable to get provider
com.marianhello.bgloc.sync.DummyContentProvider:
java.lang.ClassNotFoundException: Didn't find class
"com.marianhello.bgloc.sync.DummyContentProvider"
on path: DexPathList[[zip file "/data/app/com.netbeast.yeti.debug-2/base.apk"],
nativeLibraryDirectories=[/data/app/com.startup.app.debug-2/lib/arm,
/data/app/com.startup.app.debug-2/base.apk!/lib/armeabi-v7a,
/vendor/lib, /system/lib]]
For more info: the error comes from a library used in the native side. This is a project with react native that has a package called react-native-mauron85-background-geolocation
I've been reading a lot and searching on the internet and I have found similar questions but still no answer. So I will try again :)
I'm developing an app with phonegap 2.7 and I'm using the recommended function to upload pictures. The problem is that some users are reporting an exception when trying to select their pictures, and the app is crashing.
Looking at the google play console I can see this error:
java.lang.RuntimeException: Unable to resume activity
{com.xmile.events/com.xmile.events.MainActivity}: java.lang.RuntimeException: Failure
delivering result ResultInfo{who=null, request=18, result=-1, data=Intent {
dat=content://media/external/images/media/201233 }} to activity
{com.xmile.events/com.xmile.events.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2444)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2472)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1986)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
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:791)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null,
request=18, result=-1, data=Intent { dat=content://media/external/images/media/201233 }}
to activity {com.xmile.events/com.xmile.events.MainActivity}:
java.lang.NullPointerException
at android.app.ActivityThread.deliverResults(ActivityThread.java:2980)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2431)
... 12 more
Caused by: java.lang.NullPointerException
at org.apache.cordova.DroidGap.onActivityResult(DroidGap.java:858)
at android.app.Activity.dispatchActivityResult(Activity.java:4649)
at android.app.ActivityThread.deliverResults(ActivityThread.java:2976)
... 13 more
The function to select the image is this one:
function selectPicture() {
pictureSource=navigator.camera.PictureSourceType;
destinationType=navigator.camera.DestinationType;
// Retrieve image file location from specified source
navigator.camera.getPicture(
onPhotoURISuccess, onFail, { quality: 25,
destinationType: destinationType.FILE_URI,
sourceType: pictureSource.PHOTOLIBRARY });
}
So I understand the problem arises when a user selects an image and goes back to the main process... somehow it is dead and then a NPE comes up :'( Even more weird, it only happens to a few users and I can't reproduce it with my mobile.
Any help would be highly appreciated!
I guess you are trying with Android version 4.1 or 4.2. If it's the case so refer to this answer :
Phonegap : Upload picture crashes on Samsung mobile 4.1.2 but works fine on Google Nexus 4.3.0
I'm trying to make in-app purchase flow work in my app. I use helper classes from http://developer.android.com/training/in-app-billing/preparing-iab-app.html (IabHelper etc.). Everything's fine until I make payment. When returning to activity, this exception is raised
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null,
request=10001, result=-1, data=Intent { (has extras) }} to activity
{com.sunlight.mangomonitor/com.sunlight.mangomonitor.PurchaseActivity}:
java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException:
java.lang.RuntimeException: error:0D07209B:asn1 encoding routines:ASN1_get_object:too long
at android.app.ActivityThread.deliverResults(ActivityThread.java:3408)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3451)
at android.app.ActivityThread.access$1200(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1332)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5296)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException:
java.lang.RuntimeException: error:0D07209B:asn1 encoding routines:ASN1_get_object:too long
at com.sunlight.mangomonitor.util.Security.generatePublicKey(Security.java:92)
at com.sunlight.mangomonitor.util.Security.verifyPurchase(Security.java:66)
at com.sunlight.mangomonitor.util.IabHelper.handleActivityResult(IabHelper.java:460)
at com.sunlight.mangomonitor.PurchaseActivity.onActivityResult(PurchaseActivity.java:145)
at android.app.Activity.dispatchActivityResult(Activity.java:5444)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3404)
... 11 more
Caused by: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException:
error:0D07209B:asn1 encoding routines:ASN1_get_object:too long
at
org.apache.harmony.xnet.provider.jsse.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyF actory.java:52)
at java.security.KeyFactory.generatePublic(KeyFactory.java:171)
at com.sunlight.mangomonitor.util.Security.generatePublicKey(Security.java:87)
... 16 more
Caused by: java.lang.RuntimeException: error:0D07209B:asn1 encoding
routines:ASN1_get_object:too long
at org.apache.harmony.xnet.provider.jsse.NativeCrypto.d2i_PUBKEY(Native Method)
at org.apache.harmony.xnet.provider.jsse.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyfactory.java:48)
I found that activity that started the purchase may be destroyed, what should I do in that case?
Any suggestions?
call that purchase activity using calling activity for result concept.check whether the result at onActivityResult() function using RESULT_OK and RESULT_CANCELLED so you find out.