android-gradle

Failed to resolve: com.android.support.design:25.4.0

旧街凉风 提交于 2019-11-27 07:32:00
I added the following line to my build.gradle(Module:app): compile 'com.android.support:design:25.4.0' But when executing Gradle I'm getting Failed to resolve: com.android.support.design:25.4.0 I got that the support code from the android support design library and added it to a new project. I added it to the dependency section as such: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3

How to put my libraries in front of android.jar by editing build.gradle in Android-Studio

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 07:30:45
First Here's my Java Build Path in Eclipse: These four jars 'common.jar,core.jar, framework.jar,layout.jar' are packaged from Android source code, which contains some classes that can't be publicly used by developer.They needn't to be exported because they are for cheat compiler. In Eclipse everything is OK. Now I'm trying to import my project to Android-Studio with gradle.I've add the jars to dependencies,However I can't change the compile order of my jars and android jar. I can't put these jars in front of android jar.I'm not familiar with gradle, now the compiler can't find classes in these

\\build\\intermediates\\res\\resources-anzhi-debug-stripped.ap_' specified for property 'resourceFile' does not exist

一笑奈何 提交于 2019-11-27 07:22:36
I updated Android Studio to version 2.0. The build failed and also takes longer than Android Studio version 1.5 to build. Every time I run my application, I clean and reload the project, but it's no use. The error message is: \build\intermediates\res\resources-anzhi-debug-stripped.ap_' specified for property 'resourceFile' does not exist. Having same issue ! So instant run is not compatible with shrinkResources 1) if use Android Studio 2.2 shrinkResources false buildTypes { release { signingConfig signingConfigs.release minifyEnabled false shrinkResources false zipAlignEnabled true debuggable

Difference between google() and maven { url 'https://maven.google.com' }

天大地大妈咪最大 提交于 2019-11-27 07:11:02
Is there any difference between google() and maven { url ' https://maven.google.com ' } in build.gradle file and if there is any, what is it? allprojects { repositories { jcenter() maven { url 'https://maven.google.com' } // OR google() } } The google() repository is a shortcut to Google's maven repository. It was introduced in Gradle 4.x+. The actual repository URL used is `" https://dl.google.com/dl/android/maven2/ " as specified here. https://maven.google.com actually points to the same repository. However, if you are planning to use the google() shortcut, you need Gradle 4.x+, Android

Android tests build error: Multiple dex files define Landroid/support/test/BuildConfig

旧时模样 提交于 2019-11-27 07:07:30
I'm trying to add Espresso 2 to my project (which also has lots of other dependencies), but I'm hitting this error when trying to run tests: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Landroid/support/test/BuildConfig; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) ... The non-test build works fine. Does anybody have any tips on the best way to debug this? I've tried running ./gradlew -q :

How can I add .so files to an android library project using gradle 0.7+

别等时光非礼了梦想. 提交于 2019-11-27 07:05:16
Project structure: App project --> depends on Library project Library Project has a folder for the compiled jni libs jniLibs.srcDirs = ['libs'] And I've tried adding the following to the android element of the build.gradle as per the example app https://android.googlesource.com/platform/tools/build/+/2e1f7810edd76d92cee8d3e06bc4dec0c288adea/tests/ndkSanAngeles/build.gradle however android library projects do not support productFlavours and as such the assemble fails with "Could not find method productFlavors() for arguments [dghdhd] on project" productFlavors { x86 { ndk { abiFilter "x86" } }

How to set different applicationId for each flavor combination using flavorDimensions?

▼魔方 西西 提交于 2019-11-27 06:59:59
I have and old android app that I am trying to migrate to the android gradle build system. The app is currently built in a multi project setup and published as four different apps (two different data sets included and free/paid versions for both datasets). I have managed to get away from the multi project setup by using flavorDimensions (previously called flavorGroups), but I can not figure out how to set a different applicationId for each flavor combination. Since the app versions are already published, I need to keep the same applicationid as they currently have. Because of how my original

Gradle android build for different processor architectures

守給你的承諾、 提交于 2019-11-27 06:58:33
I want to build 4 separate apks for 4 different Android CPU processor architectures (armeabi armeabi-v7a x86 mips) using Gradle. I have native OpenCV libraries built for 4 CPU architectures in the libs folder. libs -armeabi -armeabi-v7a -x86 -mips I want to each apk only contains the OpenCV library corresponding to the correct CPU architecture. The current build script is as below: apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') compile project(':workspace:OpenCV4Android:sdk:java') } android { compileSdkVersion 11 buildToolsVersion "18.1.0" sourceSets {

Generate JavaDocs with Android Gradle plugin

帅比萌擦擦* 提交于 2019-11-27 06:48:12
How can I generate JavaDocs for an Android project using the new Gradle build system? Here is what I have come up with but it doesn't work. task generateJavadoc(type: Javadoc) { source = android.sourceSets.main.java.srcDirs ext.cp = android.libraryVariants.collect { variant -> variant.javaCompile.classpath.files } classpath = files(ext.cp) } The main problem is that I do not get the appropriate android.jar on the classpath so some of the links in the JavaDocs are not resolved. I have to find a way to get all the necessary jars on the classpath. Another problem with the approach I took is it

Android build gradle is too slow (Dependency Resolution)

☆樱花仙子☆ 提交于 2019-11-27 06:47:38
I've been working with Android Studio (my current version 1.5) for 2 years. Everything was OK, but when I downloaded Canary (2.1 p5), everything went wrong. Every time I want to create a new project or open a project or sync or import a new lib or dependency, gradle is taking too long to build — nearly 20 min . I did not do anything, I just downloaded the Canary version and ran it. Symptoms : It happened when I connected to Internet The first delay is on Gradle: Resolve dependencies ':app:_debugCompile' ... After 25 min building almost done Note : When I disconnect my Internet, gradle will