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

Android: Apps fail to build as of 7.0.2 if system requires proxy to access Internet

    Details

    • Story Points:
      5

      Description

      Summary:
      If the developer's system uses a proxy to access the Internet, then Android apps will fail to build as of Titanium 7.0.2.

      Steps to Reproduce:

      1. Delete the following folder on Mac, if it exists: ~/.gradle/caches
      2. Set up the machine to access the Internet via a proxy.
      3. Configure the proxy settings in Appcelerator Studio via its "Proxy Setup" window or via the CLI's "appc config set proxyServer".
      4. Attempt to do an Android build.

      Result:
      The build fails with follow logged errors...

      [ERROR] Failed to run dexer:
      [ERROR]   
      [ERROR] FAILURE: Build failed with an exception.
      [ERROR]   
      [ERROR] * What went wrong:
      [ERROR] A problem occurred configuring root project 'android'.
      [ERROR] > Could not resolve all files for configuration ':classpath'.
      [ERROR]    > Could not resolve net.sf.proguard:proguard-gradle:5.3.3.
      [ERROR]      Required by:
      [ERROR]          project :
      [ERROR]       > Could not resolve net.sf.proguard:proguard-gradle:5.3.3.
      [ERROR]          > Could not get resource 'https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/5.3.3/proguard-gradle-5.3.3.pom'.
      [ERROR]             > Could not GET 'https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/5.3.3/proguard-gradle-5.3.3.pom'.
      [ERROR]                > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      [ERROR]   
      [ERROR] * Try:
      [ERROR] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
      [ERROR]   
      [ERROR] * Get more help at https://help.gradle.org
      [ERROR]   
      [ERROR] BUILD FAILED in 1s
      

      Cause:
      A new "gradle" build step has been added to Titanium 7.0.2 to perform ProGuard and multidexing apps. Gradle is failing to download its module(s) from maven repositories since it is not configured to work through a proxy.

      Recommended Solution:
      Developers currently have to configure Titanium/Appc to use a proxy according to our docs here...
      http://docs.appcelerator.com/platform/latest/#!/guide/Using_Studio_From_Behind_a_Proxy
      http://docs.appcelerator.com/platform/latest/#!/guide/Appcelerator_CLI_Getting_Started

      When the Titanium build system generates the "gradle-wrapper.properties" file, it should add the CLI's proxy settings to that gradle property file as well. Gradle documents these proxy settings here...
      https://docs.gradle.org/current/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy

      Work-Around:
      Titanium developers can work-around this issue by configuring a global "gradle.properties" file with these proxy settings according to the docs here...
      https://docs.gradle.org/current/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy

      On Mac, the global file goes here...

      ~/.gradle

      On Windows, the global file goes here...

      C:\Users\<UserName>\.gradle

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code