Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25372

Hyperloop: The module android.support.v4.content.ContextCompat is missing with TiSDK 6.2.2.GA

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: Release 6.2.2
    • Fix Version/s: Hyperloop 2.2.0
    • Component/s: None
    • Labels:
    • Environment:
    • Story Points:
      5
    • Sprint:
      2017 Sprint 21 SDK

      Description

      Hi,
      While updating an app from the SDK 6.1.2 to 6.2.2, We found an issue with a custom android Hyperloop class that works as an audio record permissions check.The module android.support.v4.content.ContextCompat is missing with TiSDK 6.2.2.GA
      This error is not happening when using SDK 6.1.2
      Test code:
      ti.checkSelfPermission.js

      * @author cenciso
       */
      // Imports from Android SDK
      var Manifest = require('android.Manifest');
      var PackageManager = require('android.content.pm.PackageManager');
      var ContextCompat = require('android.support.v4.content.ContextCompat');
      var Activity = require('android.app.Activity');
       
      /**
       * @method hasRecordPermissions
       * Validates audio record permissions
       * @return {Boolean}
       */
      exports.hasRecordPermissions = function () {
      	var currentActivity = new Activity(Ti.Android.currentActivity);
      	var permission = ContextCompat.checkSelfPermission(currentActivity.getApplicationContext(), Manifest.permission.RECORD_AUDIO);
      	if (permission == PackageManager.PERMISSION_GRANTED) {
      		return true;
      	} else if (permission == PackageManager.PERMISSION_DENIED) {
      		return false;
      	} else {
      		console.warn(LOG_TAG, 'hasRecordPermissions returned ' + permission);
      		return false;
      	}
      };
      

      index.js

       
      /**
       * @property {Hyperloop.android.checkSelfPermission} permission The permission object.
       */
      var permission = require('ti.checkSelfPermission');
       
      function doClick(e) {
      	var hasPermissions = permission && permission.hasRecordPermissions();
          alert('App has record permissions:' + hasPermissions);
      }
       
      $.index.open();
      
      

      Error Log:

      [ERROR] :  TiExceptionHandler: (main) [323,323] ----- Titanium Javascript Runtime Error -----
       
      [ERROR] :  TiExceptionHandler: (main) [0,323] - In ti:/module.js:305,2
       
      [ERROR] :  TiExceptionHandler: (main) [0,323] - Message: Uncaught Error: Requested module not found: android.support.v4.content.ContextCompat
       
      [ERROR] :  TiExceptionHandler: (main) [0,323] - Source: throw new Error("Requested module not found: " + request); // TODO Set 'code' property to 'MODULE_NOT_FOUND' to match Node?
       
      [ERROR] :  V8Exception: Exception occurred at ti:/module.js:305: Uncaught Error: Requested module not found: android.support.v4.content.ContextCompat
      
      

      Thanks

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                aislam Aminul Islam
                Reviewer:
                Jan Vennemann
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-5861
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code