Tag: gradle

Resources on sibling sub module, Gradle project

I’m trying to migrate my company’s project from Maven to Gradle, so far I’ve been able to convert all POMs to the corresponding build.gradle files, but I ran across an issue in a sub module when building. – Core-UI —- Utils —- FieldPanels The sub module FieldPanel uses colors and other resources defined in Utils. […]

Android release Build failing due to shrinkReleaseMultiDexComponents

I’m having real difficulties building a release version of my app. This is part of the output I get when running ./gradlew assembleRelease –stacktrace –debug In Android Studio it spits out the same thing and I’ve crawled the net but haven’t found a solution for this. 17:57:41.664 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ‘:app:shrinkReleaseMultiDexComponents’ (up-to-date check took […]

How do I ship an Android Library (aar) with remote dependencies (gradle)?

I am trying to build an aar file with gradle that has remote dependencies. An example build script is below. As you can see I have two dependencies. The problem I’m having is when I do a release, the aar file does not contain the remote dependencies, so when I include the aar file in […]

How can I specify per flavor buildType sourceSets?

I’ve got 2 flavors of an app that each have their own google maps (v1) key for debug and release (meaning 4 keys total). So I’d like to know if I can specify sourceSets based on the buildType and productFlavor. Essentially, I’m wondering how I can achieve something like this: src ├── debug │   └── […]

Android – Manifest placeholders for different build types

I am very hyped about the new possibility of manifest placeholders in Gradle + Android Build. I’ve found in the gradle documentation that I can specify my own placeholders like this: productFlavors { free { } pro { manifestPlaceholders = [ activityLabel:”proName” ] } } But I would like to have one placeholder dependent on […]

Android Studio ignore –core-library flag

I have a project, which i want to configure on my computer. On anothe computer it works, but with old version of Android Studio 0.4.0 whenever I use 0.5.2 The proble is that after I launch app it show error Build script error, unsupported Gradle DSL method found: ‘coreLibrary()’! Possible causes could be: – you […]

java.lang.IncompatibleClassChangeError when including espresso-contrib:2.0

I have a subclass of android.support.v7.widget.RecyclerView. It works fine when I use the application and testing. However, when I include espresso-contrib in my gradle app file I get an exception when I try to run the same tests. The app still works. The same problem occurs in both sdk versions 21 and 22, on armv […]

How to set severityOverrides in lintOptions?

I have an Android project defining buildscript { repositories { jcenter() } dependencies { // Android plugin for gradle // http://google.github.io/android-gradle-dsl classpath ‘com.android.tools.build:gradle:1.5.0’ // … In my app I want to set android { // … lintOptions { // http://google.github.io/android-gradle-dsl/1.5/com.android.build.gradle.internal.dsl.LintOptions.html#com.android.build.gradle.internal.dsl.LintOptions:severityOverrides severityOverrides { [“MissingTranslation”: “warning”] } // … but I get the error Error:(34, 0) Gradle […]

Can't find org.gradle.api.artifacts.result.ResolvedModuleVersionResult when apply Android plugin in Gradle

When I upgrade gradle to 1.10 in my Ubuntu 12.04, I can’t build android gradle project, tell me Could not create plugin of type ‘AppPlugin’, debug message is like: 15:35:52.069 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NoClassDefFoundError: org/gradle/api/artifacts/result/ResolvedModuleVersionResult 15:35:52.073 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.AppPlugin.$getStaticMetaClass(AppPlugin.groovy) 15:35:52.077 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.BasePlugin.<init>(BasePlugin.groovy:1627) 15:35:52.101 [ERROR] [org.gradle.BuildExceptionReporter] at com.android.build.gradle.AppPlugin.<init>(AppPlugin.groovy:73) 15:35:52.105 [ERROR] [org.gradle.BuildExceptionReporter] at […]

Android Studio publish local library

I’ve recently switched to Android Studio from Eclipse, and its better for the most part. But now I’m at the point of wanting to create libraries to be reused later. I know about modules, but don’t want to use them, as it seems to copy a duplicate in each project (I’d rather have a reference […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.