When I call the startCardPayment function this error pops up
Related
I have a form that I open in a webview in my app, after I complete it, it will appear a button that will let me download a pdf andd open it but when I do this I keep getting the next error:
OneSignal: FusedLocationApi.requestLocationUpdates failed!
java.lang.NullPointerException: Calling thread must be a prepared Looper thread.
at com.google.android.gms.common.internal.Preconditions.checkNotNull(com.google.android.gms:play-services-basement##17.6.0:2)
at com.google.android.gms.internal.location.zzz.requestLocationUpdates(com.google.android.gms:play-services-location##18.0.0:4)
at com.onesignal.GMSLocationController$FusedLocationApiWrapper.requestLocationUpdates(GMSLocationController.java:198)
at com.onesignal.GMSLocationController$LocationUpdateListener.init(GMSLocationController.java:181)
at com.onesignal.GMSLocationController$LocationUpdateListener.<init>(GMSLocationController.java:165)
at com.onesignal.GMSLocationController.onFocusChange(GMSLocationController.java:117)
at com.onesignal.LocationController.onFocusChange(LocationController.java:326)
at com.onesignal.OneSignal.onAppLostFocus(OneSignal.java:1308)
at com.onesignal.ActivityLifecycleHandler$AppFocusRunnable.run(ActivityLifecycleHandler.java:279)
at java.lang.Thread.run(Thread.java:923)
The button will appear in the webview. I think I get that error because I open the pdf on the main thread.
I get this error -> java.lang.AssertionError: Can't find built-in class kotlin.collections.List
sometimes when I launch my application. This crash sometimes appear and sometimes do not.
My code is
SmartRecyclerAdapter
.items(listItems) // here exception is being thrown
.map(Header::class, CustomEventVH::class)
.map(Appointment::class, UpcomingVH::class)
.add(OnCustomViewEventListener{
startActivity(Intent(requireContext(), ActivityAddAttachment::class.java))
})
.into<SmartRecyclerAdapter>(binding!!.recyclerview)
The error appears at .items(listItems)
I am taking assistance from this: Call Android method from TypeScript
I just want to pass a string in a function with a key so that when function gets called from Android device, it can consume that string.
typescript file:
declare var android: WebAppInterface;
interface WebAppInterface {
showToast(toast: string): any;
}
buttonClicked() {
android.showToast('Hello Android!');
}
So when I call this function, I am getting error as ERROR ReferenceError: android is not defined
and I think that is true, but not able to resolve this issue.
Here's the code: https://stackblitz.com/edit/angular-m3t8ee
After adding following object in messages.js (located at myProject/apps/myApp/common):
WL.ClientMessages = {
wlSettings : "myApp settings"
};
Although it successfully changed from "Worklight Settings" to "myApp settings" in Android's OptionsMenu, when I look in Logcat it shows the following error:
Uncaught ReferenceError: WL is not defined at
file:///data/data/com.test/files/www/default/js/messages.js:10
Also, if I trigger a Direct Update by changing a web resource, it fails with the following error:
tag: test(my app's name)
[http://192.168.1.5:10080/test/apps/services/api/test/android/composite]
exception. TypeError: Cannot call method 'replace' of undefined
tag:CordovaLog
Uncaught TypeError: Cannot call method 'replace' of undefined
tag: Web Console
Uncaught TypeError: Cannot call method 'replace' of undefined at
file:///data/data/com.test/files/www/default/wlclient/js/worklight.js:1763
This is because of the way I previously explained my answer to this question: IBM Worklight - How to change the default "Worklight Settings" string?
I have corrected it.
This happens now because messages.js is not in the scope of the WL namespace.
By doing so it will override the whole ClientMessages object, leaving you with only one property - wlSettings. This will cause various pieces of functionality to fail, e.g. direct update failure you're experiencing is caused by the fact that WL framework cannot retrieve the required message string.
Move the object from messages.js to yourApp.js, above wlCommonInit(), and update it like this:
/* myApp.js
...
...
/*
WL.ClientMessages.wlSettings = "myApp Settings";
function wlCommonInit() {
...
...
}
I have tried implementing 3 different plug-in's for this in cordova-2.1.0
But nothing has worked out..
Plugin No: 1
source: here
error faced: full plugin file rather the java file had errors and had asked to create field names such as cordova call back content...etc
Plugin No: 2
source:here
error faced: no responsei am able to enter the phone no and message..i am supposed to get an alert with the number and message but did not get it.could not decode
Plugin No: 3
source:here
error faced: while i called just this in the sms function**
sendSMS.send(‘Mobile Number’, ‘Text’, ‘Call back function on complete’);
i got an error of
05-31 15:03:05.879: E/Web Console(15239): Uncaught ReferenceError: sendSMS is not defined at file:///android_asset/www/index.html:14.
when i gave this
var sendSMS = {
send : function(phone, message, successCallback, failureCallback) {
return cordova.exec(successCallback, failureCallback, 'SmsPlugin',"SendSMS", [ phone, message ]);
}
};
if (!window.Cordova) {
window.Cordova = cordova;
};
sendSMS.send('Mobile Number', 'Text', 'Call back function on complete');
i got a toast message as generic failure and then in the logcat as
05-31 15:04:23.082: E/ActivityThread(15400): Activity com.phone.gap.fist proj.MainActivity has leaked IntentReceiver com.phonegap.plugins.sms.SmsPlugin$2#414f1068 that was originally registered here. Are you missing a call to unregisterReceiver()?
Use the social plugin a common one for SMS,E-MAIL and opening all the social network applications available on your device.
here
Its simple to implement.