HttpClient is deprecated in target 23, so still I want to use httpClient in my project, so I added the following org.apache.http.legacy dependency to the gradle file, after recovering the project, I get the following error.
Error: (6, 0) gradle DSL method not found: 'useLibrary ()' Possible causes:
The Development project may use a version of gradle that does not contain a method. gradle Settings The build file may be missing the gradle plugin. Serve expression gradle plugin
My gradle file
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "22.0.1" useLibrary 'org.apache.http.legacy' defaultConfig { applicationId "com.android.mobile.test" minSdkVersion 15 targetSdkVersion 24 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } lintOptions{ abortOnError false } } dependencies { compile project(':library') compile 'com.google.android.gms:play-services:+' compile files('FlurryAnalytics-5.5.0.jar') compile files('HockeySDK-3.5.0.jar') compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:design:23.0.+' }
root build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.0.0' } } allprojects { repositories { jcenter() } }
source share