Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-4748

unable to build application with android platform 4.0.x

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • None
    • push
    • None

    Description

      I want to build Shoot&Share example for Cordova from here (1)

      My problem starts when I wanted to use Gradle of version bigger then 2 because Cordova 4.2 uses cordova-android of version 3.6.2 and that version uses gradle 1.10 so build fails telling me I want to use Gradle 1.10 which I do not want.

      This issue is resolved by using 4.0.x version of cordova-android plugin where it uses Gradle 2 (2), there is not such Gradle selection possibitity in lower version of a plugin.

      I cd'ed to shoot&share cloned repo and Shoot directory and executed:

      cordova platform add android@master --usegit // uses 4.0.0-dev
      cordova restore plugins --experimental
      cordova add add org.jboss.aerogear.cordova.push
      gradle wrapper
      ./gradlew installDebug
      

      This fails on ./gradlew installDebug, because of this error:

      Element uses-permission#android.permission.ACCESS_NETWORK_STATE at 
      AndroidManifest.xml:27:5 duplicated with element declared at AndroidManifest.xml:5:5
      

      This means that generated AndroidManifest.xml is invalid, because it contains duplicate elements.

      The second element which is duplicated is put there by aeroear push plugin by this https://github.com/aerogear/aerogear-pushplugin-cordova/blob/master/plugin.xml#L31

      I believe this line has to be deleted from it because it is already contained in cordova-android AndroidManifest.xml template.

      Environment:

      cordova plugins list
      
      android.support.v4 1.0.0 "Android Support v4"
      com.google.playservices 19.0.0 "Google Play Services for Android"
      com.vladstirbu.cordova.promise 1.0.0 "Promise"
      org.apache.cordova.camera 0.3.5 "Camera"
      org.apache.cordova.file 1.3.3 "File"
      org.apache.cordova.file-transfer 0.5.0 "File Transfer"
      org.jboss.aerogear.cordova.android.reflect 0.0.1 "Android reflect"
      org.jboss.aerogear.cordova.oauth2 1.0.3 "OAuth2"
      org.jboss.aerogear.cordova.push 1.0.2 "
          AeroGear PushPlugin
        "
      cordova platforms list
      Installed platforms: android 4.0.0-dev
      

      (1) https://github.com/aerogear/aerogear-cordova-cookbook/tree/master/Shoot
      (2) https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=blob;f=framework/build.gradle;h=2565633ffea2133ff04397b0cb306ae1e32263a1;hb=HEAD#l26

      Attachments

        Activity

          People

            edewit1@redhat.com Erik Jan de Wit
            smikloso Stefan Miklosovic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: