build.gradle

Gradle build using plugins and dependencies from “flatDir”

最后都变了- 提交于 2021-01-29 20:10:37
问题 How to make a gradle build if all the required jars to build the project (plugins+dependencies) are present in flatDir ? I have all the required jars in my D drive under "D:/path/to/local/directory". Now when I am trying to do a gradle build, it fails every time for different reasons. Need help in fixing the same (Gradle version 6.3). Code in my Build.gradle buildscript { repositories { // If you want to use a (flat) filesystem directory as a repository flatDir { dirs 'D:/path/to/local

“Cause: duplicate entry: AndroidManifest.xml” with a project having two manifest files

匆匆过客 提交于 2021-01-29 17:49:12
问题 I get this error "Cause: duplicate entry: AndroidManifest.xml" every time I want to build my project. I have cleaned and rebuild the project and it still gives this error. my merged manifest has no errors. This the AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.dream.chat"> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses

Gradle sync failed: Build file '…\build.gradle' should not contain a package statement

吃可爱长大的小学妹 提交于 2021-01-29 15:10:55
问题 My application was working perfectly fine, I dont know what happened all of a sudden the build.gradle throw an error stating Gradle sync failed, build file '...\build.gradle' should not contain a package statement, the thing is I checked my other apps as well and they had the same package com.example.myapplication; here is my build.gradle(project:FaceRec); package com.example.myapplication; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent;

This project uses AndroidX Dependencies,but the 'android.useAndroidX' property is not enabled

孤者浪人 提交于 2021-01-29 14:13:12
问题 I have updated my android build.gradle to latest version now i am getting an error. I have searched answers regarding this here(stackover flow),but none work for me . my build.gradle code is:---> apply plugin: 'com.android.application' android { compileSdkVersion 29 buildToolsVersion "29.0.3" defaultConfig { applicationId "com.parse.starter" minSdkVersion 16 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes {

Build failed with an exception error in Kotlin

本秂侑毒 提交于 2021-01-29 08:16:35
问题 Got this error after updating my Kotlin plugin on android studio. package com.example.test fun main(args: Array<String>) { println("Hello world") } This is the error I receive: * Where: Initialization script '/private/var/folders/bn/st769wd16nv1d5_wccw8_tm00000gn/T/Test_main__2.gradle' line: 27 * What went wrong: A problem occurred configuring project ': app'. > Could not create task ':app:Test.main()'. > SourceSet with name 'main' not found. When I run a stack trace, this is the response I

I need to have an gradle task to execute my cucumber runner class and execute cucumber tets

匆匆过客 提交于 2021-01-29 06:39:48
问题 I have my Cucumber Runner class as shown below and i need to call and run this runner class through gradle so that in turn it executes my stepdefinition / tests as we do it in normal cucumber project import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeSuite; import com.inspire.brands.helper.reporter.ReporterUtil; import io.cucumber.testng.AbstractTestNGCucumberTests; import io

Gradle - Syntax error using plugin method with closure as argument

邮差的信 提交于 2021-01-29 04:50:54
问题 Below are two tasks hello & printProperties in build.gradle : task('hello', { description("Hey student! Run this one :D") group("Our demo") doLast({println("Hello World!")}) } ) plugins({ id('java') }) ext({ springVersion = "3.1.0.RELEASE" emailNotification = "build@master.org" }) sourceSets.all({ ext.purpose = null }) sourceSets({ main({ purpose = "production" }) test({ purpose = "test" }) plugin({ purpose = "production" }) }) task('printProperties', { doLast({ println(springVersion) println

Andorid Studio - KorGE plugin - build.gradle

做~自己de王妃 提交于 2021-01-28 21:20:02
问题 I would like to use Open Source KorGE Game Engine. I'm using Android studio now and I would like to know if anyone know how to import the library. I've installed the plugin followind the setup documentation. Could anyone show me how to setup right my build.gradle? Thanks in Advance UPDATE: Following @soywiz suggestion this problem occurred: UPDATE Thanks to soywiz , now I can use KorGe In my Androdi Project. Just set in build gradle : buildscript { repositories { google() jcenter() maven {

How to compile only changed file using gradle build in java projects

送分小仙女□ 提交于 2021-01-27 21:50:56
问题 I am using gradle to build a java project. I see that whenever there is a change in one java file entire projects gets rebuilt. Is there a way to compile only affected java files instead of all the files. 回答1: Gradle now supports compile avoidance , and has support for incremental compilation since earlier. You do not have to do anything to enjoy these features. Just update Gradle. See https://blog.gradle.org/incremental-compiler-avoidance 来源: https://stackoverflow.com/questions/43042305/how

Disabling Gradle daemon in a specific project

北慕城南 提交于 2021-01-27 14:44:58
问题 I'd like to build certain projects without the use of of Gradle daemon. I've read that this can be done either by command-line argument --no-daemon or by changing Gradle properties under .gradle/ . I need to disable it for just some of the projects I build under the root project though. Is it possible via settings.gradle / build.gradle settings or am I better off making custom build script? 回答1: You can simply add org.gradle.daemon=false to a gradle.properties file in the project root folder.