Tag: gradle

How to add meta-data to gradle/AndroidStudio generated manifest

I’m migrating from an Ant/Eclipse environment to Gradle/Android Studio, and some tools we use need the Android app to have meta-data tags present with both android:name and android:value fields set. We currently have two build-variants of the app, specified as productFlavours/buildTypes in the build.gradle file. As the Android manifest.xml files are generated by gradle at […]

Using Scala with Gradle for Android project

There seems to be a memory leak somewhere. When setting up a project in IntelliJ and using the Gradle wrapper: ./gradlew assembleDebug –debug I get the following after about 5 mins: 14:30:15.245 [INFO] [org.gradle.api.Project] processing scala/collection/SeqViewLike$$anon$5.class… 14:30:53.132 [INFO] [org.gradle.api.Project] processing scala/collection/SeqViewLike$$anon$6.class… 14:33:51.027 [ERROR] [org.gradle.api.Project] 14:33:51.028 [ERROR] [org.gradle.api.Project] UNEXPECTED TOP-LEVEL ERROR: 14:33:51.028 [ERROR] [org.gradle.api.Project] java.lang.OutOfMemoryError: Java […]

Android studio uploading old apk when changing project.archivesBaseName

I have configured build.gradle so it increases version code in version.properties each time I create a release build. I also use version code for the apk filename. However Android studio seems to ignore the version changes so when I run debug build from the ide then assemble Release build using console (which increases the version […]

Writing Gradle script to run unit test cases for Eclipse Android Test project

I have a simple HelloWorld Android project (built in Eclipse IDE), I am able to do “gradle build” successfully in cmd prompt for this project. Also I have written a simple JUnit Android Test Project for it, and it runs fine in Eclipse. Now I want to run this Test Project or Unit Test Cases […]

failed to resolve com.google.firebase:firebase-core:10.0.1

I want to use Firebase Cloud Messaging in my Android App. This is my app level gradle file apply plugin: ‘com.android.application’ android { signingConfigs { config { keyAlias ‘androiddebugkey’ keyPassword ‘android’ } config1 { keyPassword ‘android’ } } compileSdkVersion 23 buildToolsVersion “23.0.3” packagingOptions { exclude ‘main/AndroidManifest.xml’ } defaultConfig { applicationId “com.shikhar.dexter.project” minSdkVersion 19 targetSdkVersion 22 […]

Cordova fails to build on android (GCM dependency)

I have already installed the latest Support Repository package for Android. However I cannot compile my new app with ionic/cordova (first build), and I get the following error: TR: ~/Documents/bitron/B-See tommaso$ ionic run –device android Running command: /Users/webdev1/Documents/bitron/B-See/hooks/after_prepare/010_add_platform_class.js /Users/webdev1/Documents/bitron/B-See add to body class: platform-android Running command: /Users/webdev1/Documents/bitron/B-See/platforms/android/cordova/run –device ANDROID_HOME=/usr/share/java/android-sdk-macosx JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home Running: /Users/webdev1/Documents/bitron/B-See/platforms/android/gradlew cdvBuildDebug -b /Users/webdev1/Documents/bitron/B-See/platforms/android/build.gradle […]

Gradle and Android : pom configuration with multiple Maven artifacts publication

Working on an Android library with Gradle (v 1.7) as the building tool, I’ve used the maven plugin and configured the task uploadArchives to publish both release and debug version of the lib to the local maven repository. The code below works ok : // […] apply plugin: ‘android-library’ // […] nothing unusual /* * […]

Android Studio local path doesn't exist

I imported my Eclipse project into Android using Gradle. At first I had problems with R.java but I resolved them by adding ‘gen’ folder as sources in Project Settings. However, even though Android Studio doesn’t show any errors any more, when I’m trying to deploy the project onto my Android device, I get the error: […]

How can Variant Outputs be manipulated using the Android Gradle Plugin 3.0.0+?

The latest version (3.0.0) of the Android Plugin for Gradle has broken its API for manipulating Variant Outputs. This API was used for manipulating files creating during builds (such as AndroidManifest.xml), and has been removed to improve configuration times. What new APIs are available to manipulate Variant Outputs, and how do they differ to the […]

How can we create a single library by combining different modules?

I want to build a single library from my project , the project uses many dependencies and resources. If cardview is imported as a jar, it won’t have the resources with it, but when it is added as aar, it is then added as another module. So i can’t combine it into a single aar […]

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