Troubleshooting Xamarin and the Good Dynamics SDK

Troubleshooting Xamarin and the Good Dynamics SDK

The Good Dynamics SDK provides Xamarin developers a wide range of containerized security features that span almost every security need on a mobile device.  This blog post serves as a list of common troubleshooting solutions to potential problems developers may run into while working with Xamarin and the Good Dynamics SDK.

Problem

I’m new to all of this.  How do I get started?

Solution

  1. Check out the Getting Started Guide and related blog posts
  2. Sign up for the Good Developer Network (GDN) and review the Xamarin documentation

Problem

I just made a change to fix a build error or application crash, but it won’t go away.  I’m pretty certain this is the right change, but it isn’t being applied.

Solution

When in doubt, clean and rebuild. Sometimes Xamarin Studio won’t recognize an architecture change such as moving files around, adding/removing packages and references, modifying project settings, and changing how the application is compiled, linked and deployed to the device.

To do this in Xamarin Studio:

  • Build -> Clean All
  • Build -> Rebuild All

Closing and reopening Xamarin Studio might help as well.  I personally have gotten into the habit of doing a clean and rebuild after each architecture change I make because it takes two seconds.

Problem

My access key is invalid.  How can I log into my Good embedded app?

Solution

Users can authenticate through Good using two methods: access keys and custom passwords.
Access Keys are generated through Good Control.  They allow a user to enter a Good embedded application for the first time.  To generate one

  1. Log in to Good Control.
  2. Navigate to Users and Groups.
  3. Select a User.
  4. Click on Access Keys.
  5. Click the “New Access Key” button.

This generates a new access for a specific user to log into a Good embedded app.  They access key expires after its used and is not case sensitive.  Capital letters are only used to improve readability of letters such as L’s, I’s and 1’s.  After the access key is used, the user will be prompted to set a custom password for future access.

The second way to authenticate is through Good for Enterprise which is a mobile collaboration software suite for enterprise employees on Good’s infrastructure.  Users on GfE have a single custom password that allows them to access any Good embedded app.

Problem

I’m running into software version compatibility issues, where can I find out the right versions to install?

Solution

Between Good Dynamics, iOS, Xcode, Xamarin Studio, Xamarin.iOS, and Mac OS; some software versions are not compatible with other versions.
Xamarin development environment compatibility info
Good development environment compatibility info

iOS Troubleshooting Tips

Problem

My application crashes on startup and the Application Output is “Crypto::initialize: FIPS_mode_set failed: fingerprint does not match”.

Solution

Enable your app to be FIPS 140-2 Compliant.  To meet FIPS 140-2 compliance, your application must be linked with the linkers provided with the Good Dynamics iOS SDK. To do this follow these steps:

  1. In Xamarin Studio, navigate to the project options for your by right-clicking the project file and selecting options.
  2. In the project options window, navigate to iOS Build.
  3. In the Additional mtouch arguments field, add the following:
    –cxx –registrar:static –linkskip=Xamarin.iOS –linkskip=System.Core –linkskip=System — linkskip=mscorelib –gcc_flags=”-B ${ProjectDir}”.
  4. Locate the file named ld that is included with every Good iOS sample application and place it in your solution file.
    Note: If you installed the Good Dynamics iOS SDK in any location other than its default location, you must modify each ld file you use.  Open up this file in a text editor and point it to the path where you installed the SDK. Do this by changing the value of the GD_SDK variable, replacing the string {YOUR_SDK_LOCATION} with the absolute path of your installation: GD_SDK=”{YOUR_SDK_LOCATION}”.

Problem

I am able to see Good’s login screen, but I’m not able to authenticate. Message “Invalid Device Wipe/Block App Denied”.

Solution

This message means there are some configuration issues between the app and Good Control.  A common configuration issue revolves around the GD Entitlement ID.  This ID represents the same application across all platforms. These are the restrictions on the GD Entitlement ID:

  • The GDApplicationID in the info.plist must match the GD Entitlement ID in Good Control center for the app’s settings.
  • The GDApplicationVersion in the info.plist must match the GDEntitlementVersion in Good Control center for the app’s settings.
  • The iOS CFBundleIdentifier and CFBundleVersion do not have to line up, but they are required to take advantage of many good dynamics features such as easy activation, multi-authentication delegation and shared services framework.

To map the GD Entitlement ID to native identifiers in Good Control:

  1. Navigate to Managed Apps > Enterprise tab.
  2. Find the desired application.
  3. Click the name of the application to edit it.
  4. Go to the Good Dynamics tab,
  5. For the GD Entitlement ID heading, click Edit.
  6. For all affected platforms, enter the associated native identifier.
  7. Click Save to save your changes, or Cancel to discard them.

Problem

I want to use Xamarin.Forms in my Good embedded iOS app, but due to no multiple inheritance support in C#, my AppDelegate class is only allowed to subclass the GDiOSDelegate or the FormsApplicationDelegate.  How do I use both?

Solution

Check out this guide on Implementing the Good Dynamics SDK with Xamarin.Forms.

Problem

Application crashes on start up with Application Output “Applications must declare URL Scheme”.

Solution

Ensure that you are following the rules and restrictions around URL Types:

  • com.good.gd.discovery is always required
  • com.good.gd.enterprise is required for in-house apps developed by an enterprise.
  • native_application_identifier.sc2 enables application to use authentication and is required for all GD
    • Example: com.example.gd.myapp.sc2
  • native_application_ identifier.sc2.GD_application_ version_number is required only if your application provides a service that must be discoverable.
    • Example: com.example.gd.myapp.sc2.1
  • native_application_identifier.sc provides backwards compatibility for authenticating with Good For Enterprise.
    • Example: com.example.gd.myapp.sc

Problem

I am getting an error when I try to use the Good Launcher in my app.  When it tries to initialize the launcher, it gives the error “unrecognized selector sent to instance”.

Solution

Using the launcher requires a tweak to the project options relating to how the launcher binding is linked to the application build.  It requires the “-ObjC” flag added to gcc_flags under additional mtouch arguments.  To find this:

  1. Go to your project options on the iOS project
  2. Locate iOS Build on the left of the options window
  3. Under Additional Options at the bottom, locate “Additional mtouch arguments”
  4. In that long string, find the “–gcc_flags” portion and insert “-ObjC” inside of the quoted collection of tags.
  5. Clean the solution and rebuild it.

Problem

Native linking error: clang: error: no such file or directory.

Solution

The project path must not have any spaces in any of the folder names that comprise the path.

 

Android Troubleshooting Tips

Problem

When I build my app, I get an error:
Java.Lang.ExceptionInInitializerError:  —> Java.Lang.RuntimeException: Cannot load good dynamics library —> Java.Lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader

couldn’t find “libgdndk.so”

Solution

This happens when the test device has a different processor architecture than what Xamarin Studio builds the application for.  Typically, a device with a relatively new architecture set is backwards compatible with more common ones.  Xamarin Studio is good about building the app so that it runs on the targeted device with one exception: debugging on a 64-bit device.

According to Xamarin Android’s Supported CPU Architectures, 64-bit runtime is still an experimental feature in Xamarin Android 5.1.x – so it is far from reliable.  In order to work around this experimental 64-bit runtime feature, make the following changes to your Xamarin Android project:

1) Project Options -> Android Build -> General tab -> Uncheck “Use shared Mono runtime”

2) Project Options -> Android Build -> Advanced tab -> Supported ABIs -> Uncheck “arm64-v8a”

To see a list of devices that support different processor architectures, see these resources:

Devices that support armeabi-v7

Devices that support x86

 

Your email address will not be published. Required fields are marked *

Phone: 312-602-4000
Email: marketing@westmonroepartners.com
222 W. Adams
Chicago, IL 60606
Show Buttons
Share On Facebook
Share On Twitter
Share on LinkedIn
Hide Buttons