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

Hyperloop Android: JS wrappers for external AAR's dependencies not generated

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Hyperloop 2.1.0
    • Component/s: Hyperloop
    • Environment:

      Titanium 6.0.1.GA
      Hyperloop 2.0.0

    • Sprint:
      2017 Sprint 07 SDK

      Description

      When including an external AAR to an Titanium Application and trying to use it, you may face issues if it has a dependency on the v4 and v7 libs.

      Steps to reproduce:
      1. Create an empty Android module. This can be done on Android Studio.
      2. In this module, include the support v7 library in the build.gradle file:

      compile 'com.android.support:appcompat-v7:23.4.0'
      

      3. Create a new class that extends from AppCompatActivity.
      4. Define this activity in your module's AndroidManifest.xml file.
      5. Build the module into an .aar and place it inside an Titanium project with Hyperloop.
      6. Inside your Titanium app, create a simple window with a button.

      var testactivity = require('com.test.ActivityTest');
       
      $.index.open();
       
      function onButtonClick(e) {
          var intent = Ti.Android.createIntent({
              className: 'com.test.ActivityTest',
          });
       
          Ti.Android.currentActivity.startActivity(intent);
      }
      

      7. Execute the project and try launching your external activity. The error below occurs because the JS wrapper of your external activity at some point requires the AppCompatActivity class and can't find it.

      Uncaught Error: Requested module not found: ./android.support.v7.app.AppCompatActivity
      

      Launching an external activity with this method works as long as it doesn't depend on an external lib (like v4 or v7).

      I've tried manually adding the v4 and v7 libraries to my Titanium project, but doing so results in several errors just like this:

      [ERROR] Failed to package application:
      [ERROR] /var/folders/1j/7_wc2wx52yzggclqvnw1wpjh0000gn/T/117029-2405-16cw5bj/res/values/attrs.xml:123: error: Attribute "actionBarSize" already defined with incompatible format.
      [ERROR] /Users/Rodolfo/Documents/Workspace/app-sandbox/build/hyperloop/android/appcompat-v7-23.4.0/res/values/values.xml:82: O
      riginal attribute defined here.
      

      Example Titanium project and Android module attached to this ticket.

        Attachments

          Activity

            People

            • Assignee:
              jvennemann Jan Vennemann
              Reporter:
              rdperottoni Rodolfo Perottoni
              Reviewer:
              Christopher Williams
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration