[ 
https://issues.apache.org/jira/browse/CB-14008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16432977#comment-16432977
 ] 

ASF GitHub Bot commented on CB-14008:
-------------------------------------

infil00p closed pull request #436: CB-14008: Updating Gradle Libraries to work 
with Android Studio 3.1.0
URL: https://github.com/apache/cordova-android/pull/436
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/bin/templates/cordova/lib/builders/GradleBuilder.js 
b/bin/templates/cordova/lib/builders/GradleBuilder.js
index 8237c739e..30d3c0fbb 100644
--- a/bin/templates/cordova/lib/builders/GradleBuilder.js
+++ b/bin/templates/cordova/lib/builders/GradleBuilder.js
@@ -247,7 +247,7 @@ GradleBuilder.prototype.prepEnv = function (opts) {
         // For some reason, using ^ and $ don't work.  This does the job, 
though.
         var distributionUrlRegex = /distributionUrl.*zip/;
         /* jshint -W069 */
-        var distributionUrl = 
process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 
'https\\://services.gradle.org/distributions/gradle-4.1-all.zip';
+        var distributionUrl = 
process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 
'https\\://services.gradle.org/distributions/gradle-4.4-all.zip';
         /* jshint +W069 */
         var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 
'wrapper', 'gradle-wrapper.properties');
         shell.chmod('u+w', gradleWrapperPropertiesPath);
diff --git a/bin/templates/cordova/lib/builders/StudioBuilder.js 
b/bin/templates/cordova/lib/builders/StudioBuilder.js
index 9587c7558..17cdfd587 100644
--- a/bin/templates/cordova/lib/builders/StudioBuilder.js
+++ b/bin/templates/cordova/lib/builders/StudioBuilder.js
@@ -223,7 +223,7 @@ StudioBuilder.prototype.prepEnv = function (opts) {
             // If it's not set, do nothing, assuming that we're using a future 
version of gradle that we don't want to mess with.
             // For some reason, using ^ and $ don't work.  This does the job, 
though.
             var distributionUrlRegex = /distributionUrl.*zip/;
-            var distributionUrl = 
process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 
'https\\://services.gradle.org/distributions/gradle-4.1-all.zip';
+            var distributionUrl = 
process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 
'https\\://services.gradle.org/distributions/gradle-4.4-all.zip';
             var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 
'wrapper', 'gradle-wrapper.properties');
             shell.chmod('u+w', gradleWrapperPropertiesPath);
             shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + 
distributionUrl, gradleWrapperPropertiesPath);
diff --git a/bin/templates/project/app/build.gradle 
b/bin/templates/project/app/build.gradle
index 586bcfa46..479b46dba 100644
--- a/bin/templates/project/app/build.gradle
+++ b/bin/templates/project/app/build.gradle
@@ -29,7 +29,7 @@ buildscript {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.0.1'
+        classpath 'com.android.tools.build:gradle:3.1.0'
     }
 }
 
@@ -42,7 +42,7 @@ allprojects {
 }
 
 task wrapper(type: Wrapper) {
-    gradleVersion = '4.1.0'
+    gradleVersion = '4.4.0'
 }
 
 // Configuration properties. Set these via environment variables, 
build-extras.gradle, or gradle.properties.
diff --git a/bin/templates/project/build.gradle 
b/bin/templates/project/build.gradle
index d982091fb..20b23fbd8 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -29,7 +29,7 @@ buildscript {
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
-        classpath 'com.android.tools.build:gradle:3.0.1'
+        classpath 'com.android.tools.build:gradle:3.1.0'
     }
 }
 
diff --git a/framework/build.gradle b/framework/build.gradle
index 565f42296..dfe37a1e5 100644
--- a/framework/build.gradle
+++ b/framework/build.gradle
@@ -31,8 +31,10 @@ buildscript {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.0.1'
-        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
+        // The gradle plugin and the maven plugin have to be updated after 
each version of Android
+        // studio comes out
+        classpath 'com.android.tools.build:gradle:3.1.0'
+        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
         classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
     }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Cordova Build fails for android in Ubuntu machine
> -------------------------------------------------
>
>                 Key: CB-14008
>                 URL: https://issues.apache.org/jira/browse/CB-14008
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-android
>    Affects Versions: cordova-android-7.0.0
>         Environment: * Os: Ubuntu 16.04 LTS
>  * node.js : 8.9.4
>  * npm: 5.8.0
>  * cordova: 8.0.0
>  * android: 7.0.0
>            Reporter: Keith Franklin jathanna
>            Assignee: Joe Bowser
>            Priority: Major
>             Fix For: 8.0.0
>
>
> h6. I run the command ``cordova build `` and I get the error:
> ```
>  Android Studio project detected
>  ANDROID_HOME=/home/keith/Android/Sdk
>  JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
>  studio
>  Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use 
> --status for details
>  :wrapper
> BUILD SUCCESSFUL
> Total time: 3.704 secs
>  Subproject Path: CordovaLib
>  Subproject Path: app
> FAILURE: Build failed with an exception.
>  * What went wrong:
>  A problem occurred configuring project ':CordovaLib'.
>  > Could not resolve all files for configuration ':CordovaLib:classpath'.
>  > Could not find android-maven-gradle-plugin.jar 
> (com.github.dcendents:android-maven-gradle-plugin:1.5).
>  Searched in the following locations:
>  
> [https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.5/android-maven-gradle-plugin-1.5.jar]
>  * Try:
>  Run with --stacktrace option to get the stack trace. Run with --info or 
> --debug option to get more log output.
>  * Get more help at [https://help.gradle.org|https://help.gradle.org/]
> BUILD FAILED in 0s
>  (node:11046) UnhandledPromiseRejectionWarning: Unhandled promise rejection 
> (rejection id: 1): Error: 
> /home/keith/Documents/personal/financeTracker/mobileApp/platforms/android/gradlew:
>  Command failed with exit code 1 Error output:
>  FAILURE: Build failed with an exception.
>  * What went wrong:
>  A problem occurred configuring project ':CordovaLib'.
>  > Could not resolve all files for configuration ':CordovaLib:classpath'.
>  > Could not find android-maven-gradle-plugin.jar 
> (com.github.dcendents:android-maven-gradle-plugin:1.5).
>  Searched in the following locations:
>  
> [https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.5/android-maven-gradle-plugin-1.5.jar]
>  * Try:
>  Run with --stacktrace option to get the stack trace. Run with --info or 
> --debug option to get more log output.
>  * Get more help at [https://help.gradle.org|https://help.gradle.org/]
> BUILD FAILED in 0s
>  (node:11046) [DEP0018] DeprecationWarning: Unhandled promise rejections are 
> deprecated. In the future, promise rejections that are not handled will 
> terminate the Node.js process with a non-zero exit code.
>  ```
>  
> h5. I make the change in the ``platforms/android/CordovaLib/build.gradle``
>  
> ```
> buildscript {
>  repositories {
>  jcenter()
>  maven {
>  // change "https://maven.google.com";
>  url "https://plugins.gradle.org/m2/";
>  }
>  }
> dependencies {
>  // classpath 'com.android.tools.build:gradle:3.0.1'
>  // change 1.5 to 2.0
>  classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
>  classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
>  }
> }
> ```
> and the build works.
> ```



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to