MicroStrategy ONE

Troubleshooting in iOS

This topic provides some tips on how to debug and resolve problems that may arise when you build a mobile application or widget that consumes and displays MicroStrategy data.  

Troubleshooting Tips

  • I cannot debug my application in Xcode

    Make sure the "Can be debugged" key in the>Entitlements.plistfile is set to YES for both the iPad and the iPhone entitlement files.

    iPhone

    iPad
     

  • Missing headers or symbols after compiling a project

    Make sure that you have added the required Mobile SDK frameworks. Refer to Setting Up a Custom Project for instructions on how to do this. If any of the framework is missing, the project will have errors. For example:

    • If MicroStrategyMobileSDK.framework is missing, you will get the following error messages: 

      Copy
      MicroStrategyMobileSDK/DataControllerImpl.h: No such file or directory
      MicroStrategyMobileSDK/DataViewerImpl.h: No such file or directory
      MicroStrategyMobileSDK/MSTRView.h: No such file or directory
    • If the AudioToolbox.framework file is missing, you will get the following error messages:

      Copy
      "_AudioServicesCreateSystemSoundID", referenced from:
      "_AudioSessionGetProperty", referenced from:
      "_AudioSessionInitialize", referenced from:
      "_AudioServicesCreatePlaySystemSound", referenced from:
    • If the MapKit.framework file is missing, you will get the following error messages: 

      Copy
      ".objc_class_name_MKReverseGeocoder", referenced from:
      ".objc_class_name_MKMapView", referenced from:
      ".objc_class_name_MKAnnotationView", referenced from: 
    • If the CoreLocation.framework file is missing, you will get the following error messages: 

      Copy
      ".objc_class_name_CLLocationManager", referenced from:
      "_.kCLLocationAccuracyNearestTenMeters", referenced from:
  • “No such file or directory” for MicroStrategy SDK headers

    If you have added the required Mobile SDK frameworks and continue to get error messages, try the following:

    1. Copy all header files under the folder “/Library/LegacyResources/Headers” into the folder “/Library/MicroStrategyMobileSDK.framework/Headers/”, and rebuild your project. Check to see if the errors disappear; if not, try the next suggestion.
    2. Add “MicroStrategyMobileSDK/” when you call MSTR headers in your customization files. Check to see if the errors disappear; if not, try the next suggestion.
    3. Confirm the values for target-specific settings Framework Search Paths and User Header Search Paths as shown below.

      1. In Xcode, click <application project name> to view the targets for the project. 

      2. Click the appropriate <target name> to view the properties for the target. 

      3. Click the Build Settings tab for the selected target. 

      4. Search for text Search Paths

      5. Double-click the Framework Search Paths setting to launch the dialog for editing this setting. 

      6. The value for this setting should be the full path to the folder that contains the framework. If it is incorrect, click + and add the full path to the folder that contains the framework. For example, to obtain this value for MicroStrategyMobileSDK.framework, right-click MSTRMobileSDK.framework (under Frameworks) and select Show in Finder. In Finder, right-click MicroStrategyMobileSDK.framework and select Get Info. Copy the entire path (up until the folder that contains MicroStrategyMobileSDK.framework) displayed as the Full Path. For example: /Users/macuser/Desktop/

      7. Click Done to close the dialog. 

      8. Double-click the User Header Search Paths setting to launch the dialog for editing this setting. 

      9. The value for this setting should be the full path to the folder that contains the headers for the framework. If it is incorrect, click + and add the full path to the folder that contains the headers for the framework. For example, to obtain this value for the folder that contains the headers for MicroStrategyMobileSDK.framework, copy the value used for the Framework Search Paths setting and append the text /MicroStrategyMobileSDK.framework/Headers. For example: /Users/macuser/Desktop/.

  • After I add a third-party framework,  I get error messages, like the ones shown below, when I run my project.

    Copy
    ld: warning: directory not found for option ‘-F’ …….
    ld: framework not found MicroStrategyMobileSDK
    clang: error: linker command failed with exit code 1(ues –v to see invocation)

    This is the result of an Xcode bug that affects framework search paths. To resolve this issue:

    1. In Xcode, click <application project name> to view the targets for the project. 

    2. Click the appropriate <target name> to view the properties for the target.  

    3. Click the Build Settings tab for the selected target. 

    4. Search for “Search Paths”.  

    5. Double-click the Framework Search Paths setting to launch the editor for this setting. Do one of the following:

      • Click + and add the full path to the folder that contains the framework.

        For example, to obtain this value for MicroStrategyMobileSDK.framework: 

        1. Right-click MicroStrategyMobileSDK.framework (under Frameworks) and select Show in Finder. 

        2. In Finder, right-click MicroStrategyMobileSDK.framework and select Get Info

        3. As the Full Path, copy the entire path (up until the folder that contains MicroStrategyMobileSDK.framework). For example: /Users/macuser/Desktop/MobileSDK/Library

      • or

      • Change "\$(SRCROOT)/../Library” to "$(SRCROOT)/../Library" by removing the leading backslash. It may also look like: "\$(SRCROOT)/../Library\"; in this case, you remove the leading and the trailing backslash.

    6. Click Done to close the editor.

  • I used the sample code provided with the Mobile SDK for building a custom iPhone application, but my application cannot connect to MicroStrategy Web and get the report data

    Make sure that you have updated the connection information in ConnectionInfo.plist with valid values for your MicroStrategy environment. The ConnectionInfo.plist file contains information about the name of the MicroStrategy Intelligent Server, MicroStrategy Web, etc. in addition to information about the project used by the application.

Log Messages to the Console During Development

To help you debug your application, you can have log messages written to the Xcode console and you can specify the level of log messages that you want to see. By default, log messages are not displayed on the Xcode console. This feature is intended to be used only for debugging during application development and not during production. If this setting is not turned off for production, the application will continue to write the logs to the device's console, affecting performance.

  • You turn console logging on by adding a DebugLogLevel parameter to the MSTRCustomizations.plist file.
  • The logging level can be set in a number of different ways:
    • An app developer can set the logging level using the Preferences.xml file, the MSTRCustomizations.plist file, or code.
    • An administrator can set the logging level using the configuration URL
    • A user can set the logging level in the log viewer.

The sequence that the application follows to determine whether to log messages to the console and what logging level to use are described below. There is a specific hierarchy for choosing the logging level to use.

  1. At launch time, the application makes the following checks:
    1. The application first checks Preferences.xml to see what the logging level is set to. The logging level is determined by the value of the <ll> attribute in the preferences.xml file.
      1. If the app developer did not change the logging level in Preferences.xml, the default value is used—"12", which indicates that Warnings should be displayed.
      2. If the app developer set a different logging level in Preferences.xml, the new value overrides the default value.
      3. If a configuration URL was used to deploy the app, the values set there overwrite the Preferences.xml file when the app is deployed. If the administrator set a different logging level in the configuration URL, the new value overrides either the default value or a value set by the app developer in Preferences.xml.
    2. The application next checks MSTRCustomizations.plist to see whether console logging is turned on and, if so, what the logging level is set to.

      If the app developer added a DebugLogLevel parameter to the property list file, the application turns console logging on. If the app developer changed the logging level, the value of that parameter overrides the logging level set in Preferences.xml.

      If the value of the DebugLogLevel parameter is set to "Off", both regular logging and console logging are turned off.

  2. At run time, the application checks to see whether the logging level preference has been overridden, either through the code or by a user selection on the log viewer. It also checks to see whether regular logging has been turned off. 
    • If no logging level has been set in the code or in the log viewer, the final logging level determined at launch time is used.
    • If the logging level has been set in the code, the new logging level set in the code overrides the logging level set at launch time (either in Preferences.xml or in MSTRCustomizations.plist).
    • If the logging level has been set in the log viewer, the new logging level set by the user overrides the logging level set at launch time (either in Preferences.xml or in MSTRCustomizations.plist).
    • If the logging level has been set both in the code and on the log viewer, the application uses the last logging level it finds.
    • If the logging level has been set to "Off" either in the code or in the log viewer, regular logging is turned off. This does not affect console logging if it was turned on in MSTRCustomizations.plist.

The logging levels that can be set in the code, Preferences.xml, or MSTRCustomizations.plist (and corresponding numeric values) are listed below: 

Logging level description Numeric value

All

0

Finest

2

Finer

4

Fine

6

Config

8

Info  (Message)

10

Warning

12

Severe (Error)

14

Off

16

The logging levels that can be set  by the user in the log viewer are listed below: 

Logging level description

All

Message

Warning

Error

Off