How to use the legacy Apache HTTP client on Android Marshmallow?

Android Studio was complaining that org.apache.http classes like org.apache.http.NameValuePair org.apache.http.client.utils.URLEncodedUtils were missing. So I added org.apache.http.legacy.jar which is in Android/Sdk/platforms/android-23/optional folder to to app/libs I also added this line to my app.gradle file compile files(‘libs/org.apache.http.legacy.jar’) But if you’re using more libraries, you can use this way compile fileTree(dir: ‘libs’, include: [‘*.jar’]) This resolved all my … Read more

com.google.android.gms:play-services-measurement-base is being requested by various other libraries

The actual problem is discussed in the May, 23rd release note of https://developers.google.com/android/guides/releases#may_23_2018 Basically, you need to bump all Play Services and Firebase libraries to their latest version (which may be different for each since version 15). You may use https://mvnrepository.com/ to find the latest version for each library. See also: https://firebase.google.com/support/release-notes/android#20180523

Android Studio 0.4 Duplicate files copied in APK META-INF/LICENSE.txt

Putting the dependecies at the top and the packageOptions at the end worked for me. apply plugin: ‘android’. Here is my full build.gradle at the app folder. dependencies { compile ‘com.android.support:support-v4:+’ compile files(‘libs/apache-mime4j-0.6.jar’) compile files(‘libs/httpmime-4.0.jar’) } android { compileSdkVersion 19 buildToolsVersion “19.0.1” defaultConfig { minSdkVersion 7 targetSdkVersion 10 versionCode 1 versionName “1.0” } buildTypes { … Read more

Error:(6, 0) Gradle DSL method not found: ‘google()’

The google() repo is a shortcut to look in Google’s Maven repository for dependencies. It was introduced with gradle v.4.0. It requires (currently) Gradle v.4 Android Studio 3.x. Gradle plugin for Android 3.x Try to use in gradle-wrapper.properties use: distributionUrl=\ https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip As gradle plugin for Android use: classpath ‘com.android.tools.build:gradle:3.0.0-beta1’ In any case (also with Android … Read more

“Gradle Version 2.10 is required.” Error

You need to change File > Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home path On Mac OS, change the path in Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home Or set Use default gradle wrapper and edit Project\gradle\wrapper\gradle-wrapper.properties files field distributionUrl like this distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

Error:Execution failed for task ‘:android:transformClassesAndResourcesWithProguardForRelease’

This bug happens when the versions of SDK, Build Tools and Gradle Plugins doesn’t match (in terms of compatibility). The solution is to verify if you are using the latest versions of them. The gradle plugins are placed in the build.gradle file of the project. Other versions are in the build.gradle file of the module. … Read more