build.gradle

Issue performing lint command in Android Studio

耗尽温柔 提交于 2019-12-08 06:45:28
问题 I am currently working on a android application which has CI/CD implementation. Everything was working as expected for gradle version 2.0.1. I was able to run ./gradlew clean build command but recently I have upgraded Application to gradle version 3.4.1. I am able to run the application on Android Device and Android Emulator. However When I am running the same command in terminal build process is getting haulted while doing lint analysis. I was using android studio version 3.0.1 with gradle

Unable to load class 'com.android.build.gradle.managed.BuildType_Impl

拟墨画扇 提交于 2019-12-08 06:45:25
问题 I am trying to do basic ndk implementation using android studio. Now i am failed to sync gradle i think that some configurations are missed from buid.gradle I getting this error Error:Unable to load class 'com.android.build.gradle.managed.BuildType_Impl'. Possible causes for this unexpected error include: Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network) The state of a Gradle build

Set Android versionCode after Gradle task completes

牧云@^-^@ 提交于 2019-12-08 06:15:17
问题 I have a task that updates my app's version code, called changeVersionCode . This task runs before my Android build tasks ( assembleRelease ), but obviously it happens after the android { } closure. This seems to mean that versionCode is set and cannot be changed even when changeVersionCode runs. Here's a simplified build script that demonstrates how I have tried to approach this problem: // .version is a file that starts at "1" the first time I call this def loadVersionCode() { // fetch

Android - Read build.gradle properties inside class

拟墨画扇 提交于 2019-12-08 05:20:54
问题 I would like to have access to build.gradle properties so I can automatize some processes in my app. This is the structure i have at the moment: rootProject/build.gradle buildscript { ext { buildTools = "25.0.2" minSdk = 16 compileSdk = 23 targetSdk = 23 versions = [supportLib : '25.0.0', multidex : '1.0.1', playServices : '10.0.1'] libs = [appcompat : "com.android.support:appcompat-v7:$versions.supportLib", design : "com.android.support:design:$versions.supportLib"] .... Other libraries and

Unable to Exclude generated classes from kotlin jacoco test coverage

泄露秘密 提交于 2019-12-08 04:57:29
问题 I am trying to exclude some generated classes from jacoco coverage report. Which is working fine with groovy but after converting to Kotlin it's not working tasks.withType<JacocoCoverageVerification> { afterEvaluate { files(classDirectories.files.forEach() { fileTree(it).apply { exclude("com/generate/**") } }) } violationRules { rule { limit { minimum = BigDecimal(0.30) } } } } tasks.getByName("check") .dependsOn(tasks.getByName("jacocoTestCoverageVerification")) But violation rule working

Failed to resolve com.google.firebase:firebase-crash:17.0.2

一个人想着一个人 提交于 2019-12-08 04:55:22
问题 I'm trying to implement a couple of features of Firebase as following; implementation 'com.google.firebase:firebase-core:16.0.4' implementation 'com.google.firebase:firebase-messaging:16.0.4' implementation 'com.google.firebase:firebase-database:16.0.4' implementation 'com.google.firebase:firebase-crash:16.0.4' implementation 'com.google.android.gms:play-services-analytics:16.0.4' The problem is that gradle sync is failing with following errors; Failed to resolve: com.google.firebase:firebase

Strange gradle error android studio

我的未来我决定 提交于 2019-12-08 03:54:56
问题 Error:org.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotter$FileCollectionSnapshotImpl cannot be cast to org.gradle.api.internal.changedetection.state.OutputFilesCollectionSnapshotter$OutputFilesSnapshot Possible causes for this unexpected error include: Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network) The state of a Gradle build process (daemon) may be

Android Gradle library build: Include & exclude files from the jar inside the generated aar

落爺英雄遲暮 提交于 2019-12-08 03:28:00
问题 I exporting Android library via building aar with Gradle, and I have requirements for the jar inside the aar : Basically I need the jar to reflect following files structure that already exist in the project (jpeg files should be inside java package alongside .class files): project_name | module_name | src | main | java | package_to_include | java_files jpeg_files package_to_exclude This is the relevant part from build.gradle script: apply plugin: 'com.android.library' android { ... sourceSets

Gradle: How to create multiple jar?

丶灬走出姿态 提交于 2019-12-08 02:52:09
问题 I'm new to Gradle and Groovy, and I'd hope there would be something to solve my problem. I have several packages, each of which needs to be compiled into one jar. One solution I've found is to create multiple tasks that are of Jar type, but I'd like to avoid copy/paste and end up with a giant gradle file whenever I add a new package to my project. My current implementation is to have multiple jar tasks, like this one : task jarFoo(type: Jar) { baseName = "foo" version = "1.0.0" String

“gradle publish” wrongly reporting up-to-date

≡放荡痞女 提交于 2019-12-08 02:51:42
问题 I'm trying to build Apache S4 and publish it to our Nexus repository. gradle publishToMavenLocal worked, so I added publishing { repositories { maven { credentials { username "admin" password "admin123" } url "http://127.0.0.1:9081/nexus/content/repositories/releases/" } } } to build.gradle after apply plugin: 'maven-publish' . This worked for other projects on the same machine. However, now I get aromanov@ws:~/etc/apache-s4-0.6.0$ gradle clean publish Build file '/home/aromanov/etc/apache-s4