Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-286

platform add android doesn't have proper repository config

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.4
    • None
    • CLI-2.x
    • OSX High Sierra

      NPM v6.0.0

      Node v8.11.1

      Java v1.8

      Cordova v8.0.0

    Description

      Unclear on if this is the correct place to categorize this issue, but the fix is simple. 

      By default, when setting up a new project: 

      ```

      cordova create cordova com.example.test CordovaTest

      cordova platform add android --save

      ```

      The resulting build.gradle does not provide the appropriate google maven repository to pull from given the android 3.0 gradle plugin. 

       

      According to: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration

      your gradle build script configuration for the Adroid 3.0 plugin should look something like:

      ```

      buildscript {
           repositories

      {            jcenter()            maven \{ url "http://jcenter.bintray.com"}

           google() // <<---- HAD TO ADD THIS!!!
           }
      }

      ````

       

      I've listed the problem as minor since Android Studio immediately realizes the issue and even gives you the option to fix it automatically, but i've been hacking purely from the CLI and kept getting cryptic errors like: "unable to find valid certification path to requested target". 

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            jalexhall Alex Hall
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified