Android Studio Instant Run and MOCA SDK

Android Studio Instant Run and MOCA SDK

It is recommended to turn off Instant Run in Android Studio. Instant Run uses portions of the SDK that might not be necessary for your integration and give you false error and warning messages.

 

Example stack trace when using Instant Run:

I/art: Rejecting re-init on previously-failed class java.lang.Class<com.innoquant.moca.location.indoortracker.NaoClient>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/polestar/naosdk/api/external/NAOSyncListener;
I/art: at com.innoquant.moca.proximity.ProximityManager com.innoquant.moca.proximity.ProximityManager.getInstance(com.innoquant.moca.MOCA$LibContext) (ProximityManager.java:67)
I/art: at void com.innoquant.moca.MOCA$LibContext.initialize() (MOCA.java:853)
I/art: at void com.innoquant.moca.MOCA$LibContext.access$000(com.innoquant.moca.MOCA$LibContext) (MOCA.java:647)
I/art: at void com.innoquant.moca.MOCA.initializeSDK(android.app.Application, com.innoquant.moca.MOCAConfig) (MOCA.java:131)
I/art: at void com.innoquant.moca.phonegap.MOCAPlugin.initialize(org.apache.cordova.CordovaInterface, org.apache.cordova.CordovaWebView) (MOCAPlugin.java:103)
I/art: at void org.apache.cordova.CordovaPlugin.privateInitialize(java.lang.String, org.apache.cordova.CordovaInterface, org.apache.cordova.CordovaWebView, org.apache.cordova.CordovaPreferences) (CordovaPlugin.java:57)

    • Related Articles

    • Android 10 and MOCA SDK

      MOCA Android SDK has been tested in the Android 10 OTA. Find the notes for this version below: Android 10 introduces a new permission model where the user can choose between “When in Use” or “Always” location permission. The SDK works correctly with ...
    • Android Permissions Detailed for MOCA SDK

      The MOCA SDK requests a variety of permissions, some of them being optional. Here is a breakdown of each permission and their effect on the SDK:   Permission Explanation android.permission.INTERNET Allows MOCA SDK to open network sockets so it has ...
    • MOCA SDK Beacon detection engine latency

      The MOCA SDK detection engine differentiates between foreground and background, and works differently in iOS and Android. For Android, in the foreground it scans more aggressively and, using the Balanced profile, detect beacons within 5 seconds ...
    • Reading MOCA SDK Logs

      The logs related to the MOCA SDK are very helpful to find configuration errors. The log starts with these two lines: I/MOCA: Initializing MOCAPlugin I/MOCA: Init MOCA SDK, version x.x.x This shows that the plugin has started, and which is the version ...
    • My Android app does not detect beacons?

      Beacon detection troubleshooting is divided in three steps: SDK configuration, device configuration and MOCA Console configuration.   1. MOCA SDK requires the following configuration checks in the MOCA.properties file: Flag proximityService is ...