I'm developing an android/PHP application and I'm using MySQL database. When I execute the code, I found this problem. I added the library android_http_client-0.2-sources.jar , but I still have the same problem.
That's what I received in logcat:
warning:unable to findoptional library:android_http_client-0.2-sources.jar
This is build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:23'
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.mouna.androidproject"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
android {
useLibrary 'android_http_client-0.2-sources.jar'
}
Try this
apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:23'
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
...
and delete this at the bottom:
android {
useLibrary 'android_http_client-0.2-sources.jar'
}
Related
I'm trying to use material design. But 'com.android.support:design-v7:25.0.0' is giving the following error.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.usaukglu.scrollabletab"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design-v7:25.0.0'
}
Error:Failed to find: com.android.support:design-v7:25.0.0 Open File.
Open in Project Structure dialog
Replace that line with this and it would definitely work.
'com.android.support:design:25.0.0'
Step 1: Open the build.gradle file for your application.
Step 2: Make sure that the repositories section includes a maven section with the "https://maven.google.com" endpoint. For example:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
there is some bug in the v7:25.0.0,(its for nougat) the preview of your layout will not be shown properly, so try to use v7:24.2.1,
but you need to install build tool
compileSdkVersion 24
buildToolsVersion "24.0.2"
compile 'com.android.support:appcompat-v7:24.2.1'
Copy paste this code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.usaukglu.scrollabletab"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design-v7:25.0.0'
}
you had to change buildToolsVersion "21.1.2"
to buildToolsVersion "25.0.0"
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "liefsolutions.com.thebestservice"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'buildToolsVersion 24.9.5'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
}
When I change compileSdkVersion from 'android-N' and targetSdkVersion from 'N' both to the integer 21 in build.gradle minSdk(API, N preview ) != deviceSdk(API 21) is not solved. Any hints?
apply plugin: 'com.android.application'
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.noureddine_ouertani.www.wocelli40"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0-beta1'
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "de.ts.prosper"
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:21.0.3'
}
Hi :)
Android Studio put this error message -
failed to find target with hash-string android-21
What is wrong? SDK 21 is installed in SDK and 23 also
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "de.tetzisoft.prosper"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
}
Now it Looks like this and it doesn't work - ???
Failed to sync gradle Project ???
Your compile version should be the same as buildToolsVersion "23.0.1".
Please change it to 23.
Also in dependencies set compile 'com.android.support:appcompat-v7:23.1.1'
I've just run your code and it works. You should maybe clean and rebuild the project.
I have a little problem with Android Studio:
Failed to resolve: 'com.android.support:appcompat-v7:16.+'
I also tried to install repository but appear another error.
apply plugin: 'com.android.application'
android {
compileSdkVersion 16
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "p11zt.futebol24"
minSdkVersion 16
targetSdkVersion 16
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
} }
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:16.+' }
Change compile sdk to 23 try this
compileSdkVersion 23
targetSdkVersion 23
and use support:appcompat
compile 'com.android.support:appcompat-v7:23.0.0'
Android Studio does not provide me all methods of the "Bundle"-class.
When I want to use .getString(), it shows me as an error. I have no clue why !?!?!
That is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "test.android.com.test"
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':facebook')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.nineoldandroids:library:2.4.+'
compile 'com.android.support:support-v13:20.0.+'
compile 'com.google.android.gms:play-services:4.2.42'
compile 'com.mcxiaoke.volley:library:1.0.6'
}
Finally I found a solution. If someone has the same problem here you go.
Change from:
compileSdkVersion 20
buildToolsVersion "20.0.0"
Change to:
compileSdkVersion 19
buildToolsVersion "19.0.0"