build.gradle

Gradle sync failed: Could not find method Dependencies() for arguments

若如初见. 提交于 2019-12-11 16:47:56
问题 Full error: Gradle sync failed: Could not find method Dependencies() for arguments [build_aewao5k4tyewg69imdynjiuxi$_run_closure1$_closure3@7c332105] on object of type org.gradle.api.internal.initialization.DefaultScriptHandler. Top level build.gradle: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { mavenCentral() google() jcenter() } Dependencies { classpath 'com.android.tools.build:gradle:3.0.1' } } 回答1: Use

JFrog / Artifactory plugin for file download in Gradle

南笙酒味 提交于 2019-12-11 16:39:47
问题 I know there are external plugins like the one in the link: https://www.michel-kraemer.com/gradle-download-task-download-files-with-progress/ for downloading files through Gradle. But since I have to download the files from Artifactory, I was wondering if there are any JFrog/Artifactory plugins to download files from Artifactory in Gradle. Can anyone please provide code also? 回答1: JFrog has a Gradle plugin, with examples available on Github. You can find additional documentation in this Jfrog

Gradle - Multiple Jar from single project

隐身守侯 提交于 2019-12-11 15:59:03
问题 Context: To create multiple executable jar's from a single project - multiple package gradle project Issue: I refer to the solution provided in Link, this helps in generating the jar in build->libs folder, but when I try executing the jar nothing happens Note: Even if I make the package name same as java file name, the generated jar does not execute. Also I notice the file size of all the jar's generated is the same. Hope the issue faced is clear & await inputs as to where I am making a

some Errors after migration to AndroidX

一笑奈何 提交于 2019-12-11 15:57:30
问题 some errors after migration to AndroidX I downloaded LeafPic-master project( it is a gallery source code for Android studio)and try to change minsdkversion and targetSdkVersion( I want to install my app on android 4.4 to newest android api).So I add the google() repo in the repositories to solve some problems then migrate to AndroidX. the list of my errors is: ERROR: Failed to resolve: androidx.recyclerview:recyclerview:1.0.0 Show in Project Structure dialog Affected Modules: app ERROR:

No signature of method: java.lang.String.div() is applicable for argument types: (java.lang.Integer)

一曲冷凌霜 提交于 2019-12-11 15:53:34
问题 I am trying to create version numbers based git commits, but I keep getting the following error when I run gradle (this is in the build.gradle file) ext { // Get version number and build number def gitNum = "git rev-list --count master".execute().text.trim() def version = (gitNum / 10) def build = (gitNum.toInterger % 10) } Error: No signature of method: java.lang.String.div() is applicable for argument types: (java.lang.Integer) values: [10] Possible solutions: is(java.lang.Object), drop(int

Android Bundle Build Error : FileUsesReservedNameException

限于喜欢 提交于 2019-12-11 15:43:04
问题 I am trying to use Android App Bundle but getting an error of "File 'root/AndroidManifest.xml' uses reserved file or directory name 'AndroidManifest.xml'." I have two .aar and one .jar file in my libs folder, and tried getting a bundle by both Build>Build bundles and "./gradlew bundle", but still got the error. This is actually a rewrite of a project, and the old project which uses the same dependencies creates a bundle without a problem. The error happens in gradle task

Task 'Xmx512m' not found in root project

雨燕双飞 提交于 2019-12-11 15:35:32
问题 Task 'Xmx512m' not found in root project 'MyProject' in gradle.properties it's showing Xmx1024m. How can i get rid off this gradle build error? My OS is windows 10. build.gradle Module apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "in.ravisir.mateinstitute" minSdkVersion 17 targetSdkVersion 24 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard

Failure [INSTALL_FAILED_OLDER_SDK] error from Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version L

拥有回忆 提交于 2019-12-11 14:54:56
问题 Recently I was receiving this error. Manifest merger failed : uses-sdk:minSdkVersion 11 cannot be smaller than version L So I changed it to minSdkVersion 'L' And then I got this error Failure [INSTALL_FAILED_OLDER_SDK] So I guess I did not resolve the first error correctly. I'm not exactly sure what to do. I've been following this: Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1 Manifest merger

react-native run-android => Could not resolve all dependencies for configuration ':classpath'

♀尐吖头ヾ 提交于 2019-12-11 14:18:50
问题 I insert java_home in environment correctly and test it in cmd. I am connecting to the internet with the proxy and can download react-native packages. adb devices run correctly on cmd, but when running "react-native run-android" command I give below error: D:\amoz\react-native\1\pro\test>react-native run-android Scanning folders for symlinks in D:\amoz\react- native\1\pro\test\node_modules (8 7ms) Starting JS server... Building and installing the app on the device (cd android && gradlew.bat

Gradle DSL error not found mavenCentral()

巧了我就是萌 提交于 2019-12-11 13:17:10
问题 I have tried to add some dependencies to my project but i kepp getting this error: Error:(21, 0) Gradle DSL method not found: 'mavenCentral()' Possible causes:<ul><li>The project 'My Application' may be using a version of Gradle that does not contain the method. <a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin. <a href="apply.gradle.plugin">Apply Gradle plugin</a></li> I have tried everything to solve it. here are my gradle files: