build.gradle

How to add Apache HTTP API (legacy) as compile-time dependency to build.grade for Android M?

眉间皱痕 提交于 2019-11-26 01:44:50
问题 As mentioned here, Android M will not support the Apache HTTP API. The docs state to: use the HttpURLConnection class instead. or To continue using the Apache HTTP APIs, you must first declare the following compile-time dependency in your build.gradle file: android { useLibrary \'org.apache.http.legacy\' } I have converted much of my project\'s usage of HttpClient to HttpURLConnection, however, I still need to use the HttpClient in a few areas. Hence, I am trying to declare \'org.apache.http

Android Studio gradle takes too long to build

自闭症网瘾萝莉.ら 提交于 2019-11-26 01:38:40
问题 My Android Studio project used to build faster but now it takes a long time to build. Any ideas what could be causing the delays? I have tried https://stackoverflow.com/a/27171878/391401 but no effect. I dont have any Anti virus running which could interrupt the builds. My app is not that big in size as well (around 5MB ) and it used to build within few seconds but not sure what has changed. 10:03:51 Gradle build finished in 4 min 0 sec 10:04:03 Session \'app\': running 10:10:11 Gradle build

Android Material and appcompat Manifest merger failed

社会主义新天地 提交于 2019-11-26 01:37:14
问题 I have next grade dependencies { implementation fileTree(dir: \'libs\', include: [\'*.jar\']) implementation \'com.android.support:appcompat-v7:28.0.0-rc01\' implementation \'com.android.support.constraint:constraint-layout:1.1.2\' testImplementation \'junit:junit:4.12\' androidTestImplementation \'com.android.support.test:runner:1.0.2\' androidTestImplementation \'com.android.support.test.espresso:espresso-core:3.0.2\' implementation \'com.google.android.material:material:1.0.0-rc01\' } But

Adding local .aar files to Gradle build using “flatDirs” is not working

你说的曾经没有我的故事 提交于 2019-11-26 00:35:58
问题 I\'m aware of this question: Adding local .aar files to my gradle build but the solution does not work for me. I tried adding this statement to the top level of my build.gradle file: repositories { mavenCentral() flatDir { dirs \'libs\' } } I\'ve also put the slidingmenu.aar file into /libs and referenced it in the dependencies section: compile \'com.slidingmenu.lib:slidingmenu:1.0.0@aar\' but it did not work at all. I tried compile files(\'libs/slidingmenu.aar\') as well but with no luck.

How do I tell Gradle to use specific JDK version?

浪子不回头ぞ 提交于 2019-11-26 00:22:26
问题 I can\'t figure out to get this working. Scenario: I have an application built with gradle The application uses JavaFX What I want Use a variable (defined per developer machine) which points to an installation of a JDK which will be used for building the whole application / tests / ... I thought about having the gradle.properties file, defining the variable. Something like JAVA_HOME_FOR_MY_PROJECT=<path to my desired JDK> What I don\'t want point JAVA_HOME to the desired JDK I could live with

Building and running app via Gradle and Android Studio is slower than via Eclipse

笑着哭i 提交于 2019-11-26 00:09:02
问题 I have a multi-project (~10 modules) of which building takes about 20-30 seconds each time. When I press Run in Android Studio, I have to wait every time to rebuild the app, which is extremely slow. Is it possible to automate building process in Android Studio? Or do you have any advice on how to make this process faster? In Eclipse, thanks to automatic building, running the same project on an emulator takes about 3-5 seconds. This is my build.gradle file (app module): buildscript {

How to add local .jar file dependency to build.gradle file?

霸气de小男生 提交于 2019-11-25 23:59:08
问题 So I have tried to add my local .jar file dependency to my build.gradle file: apply plugin: \'java\' sourceSets { main { java { srcDir \'src/model\' } } } dependencies { runtime files(\'libs/mnist-tools.jar\', \'libs/gson-2.2.4.jar\') runtime fileTree(dir: \'libs\', include: \'*.jar\') } And you can see that I added the .jar files into the referencedLibraries folder here: https://github.com/WalnutiQ/wAlnut/tree/version-2.3.1/referencedLibraries But the problem is that when I run the command:

All com.android.support libraries must use the exact same version specification

天大地大妈咪最大 提交于 2019-11-25 23:57:05
问题 After updating to android studio 2.3 I got this error message. I know it\'s just a hint as the app run normally but it\'s really strange. All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.1.1, 24.0.0. Examples include com.android.support:animated-vector-drawable:25.1.1 and com.android.support:mediarouter-v7:24.0.0 my gradle: dependencies { compile fileTree(dir: \'libs\', include: [\'*.jar\'])

What&#39;s the difference between implementation and compile in Gradle?

99封情书 提交于 2019-11-25 23:00:51
问题 After updating to Android Studio 3.0 and creating a new project, I noticed that in build.gradle there is a new way to add new dependencies instead of compile there is implementation and instead of testCompile there is testImplementation . Example: implementation \'com.android.support:appcompat-v7:25.0.0\' testImplementation \'junit:junit:4.12\' instead of compile \'com.android.support:appcompat-v7:25.0.0\' testCompile \'junit:junit:4.12\' What\'s the difference between them and what should I

How can I use external JARs in an Android project?

谁说胖子不能爱 提交于 2019-11-25 21:47:22
问题 I have created an Android project and added an external JAR (hessian-4.0.1.jar) to my project. I then added the JAR to the build path and checked it off in Order and Export. Order and Export is ignored it seems, and all classes from the external JAR are missing at runtime. Is there a trick to properly include the needed classes from an external JAR when building an Android application using the Eclipse plugin? I do not want to use ant or Maven. 回答1: For Eclipse A good way to add external JARs