build.gradle

build.gradle - Could not find method copyDeps() for arguments

陌路散爱 提交于 2020-04-17 21:30:38
问题 Below is the build.gradle file: plugins({ id('application') id 'java' id('com.github.johnrengelman.shadow').version('4.0.1') }) allprojects( { apply(plugin: 'application') apply(plugin: 'java') apply(plugin: 'com.github.johnrengelman.shadow') repositories({ mavenCentral() }) ext({ vertxVersion = '3.7.0' commitTimestamp = { return "git log -1 --pretty=format:%cd --date=format:%Y%m%d%H%M%S".execute().text.trim() } commitId = { return "git rev-parse --short HEAD".execute().text.trim() } buildId

Could not find method implemetation() for arguments [com.android.support:appcompat-v7:28.0.0]

随声附和 提交于 2020-04-17 20:35:38
问题 build.gradle(project): apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 29 buildToolsVersion "29.0.3" defaultConfig { applicationId "com.sheikhrasik.countries" minSdkVersion 21 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize

Why does my jar file not not contain any class files?

旧街凉风 提交于 2020-04-11 04:35:49
问题 I'm trying to add a task ( gen or gen2 ) to my build.gradle that does exactly the same as the Jar -task: version = "0.0.1" apply plugin: 'java' task('gen', type: Jar) { } task gen2(type: Jar) Running gradle jar generates a JAR-file that contains .class -files, while running gradle gen or gradle gen2 generate a JAR-file that does NOT contain any .class -files. Whats wrong with my class definition? 回答1: To build a jar with all the classes from main, as a default jar task would, do this: task

how does gradle resolve conflicting dependency versions

不问归期 提交于 2020-03-23 15:41:04
问题 Say I have 3 modules with 3 different build.gradle property files. Module A v1 has the following entries in build.gradle ATLAS_VERSION = 1 Module B v1 has the following entries in build.gradle ATLAS_VERSION = 2 MODULE_A_VERSION = 1 Module C v1 has the following entries in its build.gradle ATLAS_VERSION = 3 MODULE_B_VERSION = 1 So my question is: what ATLAS version will be resolved during runtime? 回答1: According to this Gradle documentation Managing Transitive Dependencies, in case you don't

Dagger 2 is not generating my component class

蹲街弑〆低调 提交于 2020-03-21 12:57:58
问题 I am working with Dagger 2 to create my dependency injection. It was working a few hours ago but now the components aren't generated anymore. Here is where I am creating the components: public class App extends Application { CacheComponent mCacheComponent; ApiComponent mApiComponent; DataBaseComponent mDataBaseComponent; @Override public void onCreate() { super.onCreate(); mCacheComponent = DaggerCacheComponent.builder() .cacheModule(new CacheModule(getApplicationContext())) .build();

Getting error says - “Entry name 'res/layout/test_toolbar.xml' collided” while creating signed apk

穿精又带淫゛_ 提交于 2020-03-18 11:47:05
问题 I have updated my android studio from 3.5.x to 3.6 today and getting error while generating signed apk for build variant showing the following message - Entry name 'res/layout/test_toolbar.xml' collided I don't have any layout named like this one in the whole project at all. I have custom build variant named " stage " and whenever I am trying to build an signed apk, it always fails. I count find any solution yet. Please help me with this issue. Thanks 回答1: I've got the same problem after this

Android multi module test dependency

这一生的挚爱 提交于 2020-03-18 03:28:06
问题 With Android Studio 3.0 / android_gradle_version = '3.0.1' / gradle-4.5 Let's say I have two android modules module-base module-a When I want to access sources from module-base in module-a , I just need to write this in my module-a.gradle dependencies { implementation project(path: ':module-base') } But, what if I want to access test sources from module-base in test of module-a ? Here does not work approach like above dependencies { testImplementation project(path: ':module-base') } I found

Android multi module test dependency

为君一笑 提交于 2020-03-18 03:28:02
问题 With Android Studio 3.0 / android_gradle_version = '3.0.1' / gradle-4.5 Let's say I have two android modules module-base module-a When I want to access sources from module-base in module-a , I just need to write this in my module-a.gradle dependencies { implementation project(path: ':module-base') } But, what if I want to access test sources from module-base in test of module-a ? Here does not work approach like above dependencies { testImplementation project(path: ':module-base') } I found

How to configure build types vs. product flavors?

浪尽此生 提交于 2020-03-17 05:51:46
问题 Based on this answer https://stackoverflow.com/a/27908019/5156317 I have a follow up question: What makes an app different that speaks for product flavours? I am trying to compare this with my XCode setup which is as follows: Dev App that uses test backend Dev App that uses production backend Test App that uses test backend (enterprise distribution) Test App that uses production backend (enterprise distribution Live App that uses production backend (app store distribution) My thoughts for the

Updated AndroidStudio(3.5.3) not building Android Project, Caused by: org.gradle.api.resources.ResourceException:Unable to load Maven meta-data

佐手、 提交于 2020-03-10 05:06:43
问题 Updated Android Studio not building Android Project, before it was building. I have checked with Proxy settings still it is getting same Below are the exceptions after rebuilding the Android Project. org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'Gsa2_NewMenu'. Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom'. at org.gradle