Xamarin Android App using FCM crashes at runtime due to java.lang.RuntimeException caused by java.lang.ClassNotFoundException - xamarin.android

My Android app developed in Xamarin crashes when notifications feature is implemented using FCM with linking set to "SDK Assemblies Only" in Relese
Below are the details,
Xamarin 16.11.000.197 (d16-11#6934992)
Xamarin Designer 16.11.0.47 (remotes/origin/d16-11#e0d612363)
Xamarin Templates 16.10.5 (355b57a)
Xamarin.Android SDK 12.0.0.3 (d16-11/f0e3c2d)
Xamarin.iOS and Xamarin.Mac SDK 15.2.0.17 (738fde344)
Dex compiler = d8 Code Shrinker = r8 Linking = SdkOnly
"Xamarin.Firebase.Analytics" Version 119.0.1.1
"Xamarin.Firebase.Iid" Version 121.1.0.1
"Xamarin.Firebase.Messaging" Version 122.0.0.1
"Xamarin.GooglePlayServices.Base" Version 117.6.0.1
I have tried updating nuget packages but it gives linking errors.
I also tried commenting out com.google.firebase.iid.FirebaseInstanceIdInternalReceiver and com.google.firebase.iid.FirebaseInstanceIdReceiver from AndroidManifest.xml as FirebaseMessaging.Instance.GetToken() is used.
App still crashes for FCM notification feature when linking set to "SDK Assemblies Only"
Crash details from Google Play Console :
java.lang.RuntimeException:
at android.app.ActivityThread.handleReceiver (ActivityThread.java:4445)
at android.app.ActivityThread.access$1900 (ActivityThread.java:253)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2198)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:233)
at android.os.Looper.loop (Looper.java:344)
at android.app.ActivityThread.main (ActivityThread.java:8183)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:584)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1034)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:218)
at java.lang.ClassLoader.loadClass (ClassLoader.java:379)
at java.lang.ClassLoader.loadClass (ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateReceiver (AppComponentFactory.java:110)
at androidx.core.app.CoreComponentFactory.instantiateReceiver (Unknown Source)
at android.app.ActivityThread.handleReceiver (ActivityThread.java:4438)

Related

Delphi 10.3 Android Remote Service crash when binding

I tried to build an APP with a remote service, and the service will communicate to other APP that I would like to check it still running.
I reference the FMX.Remote Service Demo Sample create a Multi-Device project and a Android Remote Service project, and add some code to create RemoteServiceConnection and call BindService procedure.
But APP crash when it call BindService, then I tried to build Sample but also crash when I press Bind button.
I build the Sample on Mi Pad 4, Oppo R9sk, HUAWEI MediaPad M5 lite, and Mi 6, are all the same result, and Mi 6 report the message:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file
"/data/app/com.embarcadero.AppRemoteHost-EOCjVTj9dNHejm_JDi44nw==/base.apk"],
nativeLibraryDirectories=[/data/app/com/embarcadero.AppRemoteHost-EOCjVT9dNHejm_JDi44nw==/lib/arm,
/data/app/com.embarcadero.AppRemoteHost-EOCjVTj9dNHejm_JDi44nw==/base.apk!/lib/armeabi-v7a,
/system/lib, /system/vendor/lib]]] couldn't find "libProxyAndroidService.so"
at
at java.lang.Runtime.loadLirary0(Runtime.java:1012)
at java.land.System.loadLibrary(System.java:1669)
Anyone can help?
Please add the following code to inside defaultConfig of project-level build.gradle file.
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}

GoogleVR SDK and VLC library integrated via pod not working together in iOS

In my iOS application, I have to play 360 videos with ambisonic effect, so I have integrated the VLC library for these requirements. But later I have one more requirement support VR mode for playback, so I want to integrate GoogleVR SDK via pod. But after this integration, my application stops working with the following error
"[libprotobuf FATAL google/protobuf/stubs/common.cc:67] This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 3.1.0. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "blaze-out/ios_x86_64-opt/genfiles/vr/courtside/proto/projection_proto.pb.cc".)
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException"
If anyone knows the fix for this issue, please share that with me. If VLC can play VR Mode, then that would be fine.

iOS app cannot connect to MobileFirst server

i created an hybrid application that should connect to the MFP and consume data.
When i try to connect to the Desktop Browser Application everything is fine and the app works. Same behaviour when i try the Mobile Web Application. BUT when i try to connect with the mobile native iOS application i could not connect and receive the following error (in the console):
2015-11-12 17:22:15.031 APPXYZ[6072:3089110] [FATAL] [NONE] Uncaught Exception: TypeError: WLJSX.Ajax.WLRequest.setConnected is not a function. (In 'WLJSX.Ajax.WLRequest.setConnected(false)', 'WLJSX.Ajax.WLRequest.setConnected' is undefined) at (compiled_code):3871
My specs:
MFP version 7.1.0.00.20151107-1653
Xcode 7.1.1
iOS deploy target 8.0
Transport security protocol is deactivated (Allow Arbitrary Loads -> YES)
I cannot confirm this claim.
Using the following, I create a blank new Hybrid app with the iPhone environment, that calls the WL.Client.connect method in wlCommonInit() and displays an alert with "success" or "failure" accordingly. I got "success". No errors in the Xcode Console.
Xcode 7.1.1
IBM MobileFirst Platform Studio 7.1.0.00-20151107-1647
If you are doing something different in your project, do let us know...
The solution of my problem was that i change the init calling sequence of my app. I called the wl specific functions to early. After changing the sequence my app runs perfectly.....
thx 4 help :)

IBM Worklight Application Center iOS unresponsive to touch events

After successfully building and deploying the IBMAppCenter project, when attempting to download the IBM Application Center on iOS devices, there is no response when clicking on the actual installer link. This occurs on both real devices and through the simulator. Android application seems to be working just fine. I've provided a picture here showing some of the errors messages that we're seeing when clicking on 'IBM App Center iOS', as well as provided a subset of them below (http://i.imgur.com/vLrhVjT.jpg):
Deprecated attempt to access property 'changedTouches' on a non-TouchEvent object.
Deprecated attempt to access property 'target' on a non-Event object.
TypeError: undefined is not an object (evaluating 'a.target.getAttribute')
...
Deprecated attempt to access property 'which' on a non-UIEvent object.
App Center Console version 6.2.0.00-20140613-0730
IBM Worklight Studio version 6.2.0.1
Any idea what may be causing this, and how we can correct it? Thanks!
Make sure you are using a recent iFix of Worklight 6.2.0.x containing required Dojo fixes in order to add support for iOS 8 (which you are likely attempting to use the app on).
You can review the following tech note for instructions on downloading and installing the iFix: http://www-01.ibm.com/support/docview.wss?uid=swg21684538

IBM Worklight - How to enable App Authenticity in a native iOS app?

We have a iOS and Android Hybrid App Environment in which we have App Authenticity successfully running (drop down available to control the feature) using:
<mobileSecurityTest name="app">
<testAppAuthenticity/>
<testUser realm="wl_anonymousUserRealm"/>
<testDeviceId provisioningType="none" />
</mobileSecurityTest>
We added a "iOS Native API" project to our Worklight project that we use for our native iOS client development in XCode 5. We are successfully able to connect to the WL server and call all our existing adapter procedures in our different adapters.
For this native API project, we now would like to enable App Authenticity as well. When we use the same MobileSecurityTest as in the hybrid app in the application descriptor of the native API project we can deploy it to our WL server and the App Authenticity feature is enabled (drop down available to control the feature) at the iOS Native API entry in the console.
On the native iOS app/project we set:
bundle ID is exactly the same as in the hybrid project and the same as in the Apple Developer portal
Key Chain is enabled in the project and also set to worklight.group (as in the hybrid XCode project)
we are not able to get a successful authentication running when we want to connect to WL server. We see that the DeviceAuthManager tries to get the UUID from the device, but then the server returns an error response:
2013-09-24 08:58:35.530 App[32535:c07] DeviceAuthManager:getWorklightUniqueDeviceId --> returning UUID from the keychain
2013-09-24 08:58:35.564 App[32535:c07]
isCustomResponse
2013-09-24 08:58:35.564 App[32535:c07] this is it: Status: 403
InvocationResult: (null)
InvocationContext: {
delegate = "<MyConnectionListener: 0x7d73ec0>";
}
Response text: /*-secure-
{"WL-Authentication-Failure":{"wl_authenticityRealm":{"reason":"com.ibm.json.java.JSONObject cannot be cast to java.lang.String"}}}*/
2013-09-24 08:58:35.564 App[32535:c07] [ERROR] Worklight: -[WLRequest requestFailed:]:309::Status code='403' error='(null)'
2013-09-24 08:58:35.565 App[32535:c07] [ERROR] Worklight: -[WLClient onInitRequestFailure:userInfo:]:410::
We did try this with and without a registered ChallengeHandler that just prints the response. The same results, just that we can see the error response printed in the isCustomResponse method if we have the ChallengeHandler.
Also, a Worklight dialog is shown automatically that says "Error: An error was encountered while processing the request from the application (CLOSE)".
We can see that in 6.0 there is the worklight.plist value:
<key>wlUid</key>
<string>wY/mbnwKTDDYQUvuQCdSgg==</string>
is that also necessary in 5.0.6? Our plist file there does not have that.
When we change the environment value in the worklight.plist file from iOSnative to our app name (or something else) we get a response Response text:
{"errorCode":"UNEXPECTED_ERROR","errorMsg":null}
so I assume this value iOSnative is a fixed value that has to be there?
Sept 30th: WL 6.0.0.1 Update
In WL 6.0.0.1 it seems to not show the same bug when we used it with a Studio 6.0.0 generated iOSApi Environment deployed to a Consumer Server on Tomcat.
Now we are getting an:
Invocation Failure: Status: 403
InvocationResult: {
"WL-Authentication-Failure" = {
"wl_authenticityRealm" = {
reason = "forbidden state";
};
};
}
when we have Enabled, blocking and we can connect and call Adapters when we change to Enabled, servicing. (which was not possible with the 5.0.6 bug before)
Now we assume we need to somehow setup our iOS Certificates or Signatures that we use to sign the app for the iOS Simulator and for the iOS Devices (Developer and Distribution Certificates) on the Wl server, so that the WL Server allows a connection?
Could someone help us with the steps that we need to take to setup an iOS native App Authenticity in our XCode 5 project to successfully connect to the server and after that call our adapters with Enabled, blocking.
We did add worklight.group to the turned-on Keychain Sharing capability of the iOS app.
We copied all Wl iOSAPI files including the plist file with the wlUid into the iOS app xCode5 project?
As mentioned above, it works with Enabled-Servicing and with Disabled AppAuthenticity fine.
For App Authenticity to function in a native iOS application using the Worklight Native API for iOS, the steps are the same as in a Hybrid application on the Eclipse side:
Setup the securityTest in authenticationConfig.xml
Add the securityTest to the iPhone environment application-descriptor.xml
Add your bundleId to the iPhone environment in application-descriptor.xml
There is, however, 1 extra step to do - in Xcode.
Once you open the generated Xcode project:
Under Build Settings > Linking > Other Linker Flags
Add the flag -ObjC
Now you can Clean and/or Run the project on the iOS Simulator/device. Should work.

Resources