I started to work with Gradle. And when I add this code into build.gradle;
compile 'com.android.support:appcompat-v7:+'
Im getting this error:
"Dependency 'com.android.support:appcompat-v7:+' Not Found"
So, how can I add appcompat support to my project?
My build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
applicationId "my.project.package"
minSdkVersion 9
targetSdkVersion 21
versionCode 3
versionName "1.27"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/jsoup-1.8.3.jar')
}
Related
Hi everyone I'm new to android, what I'm trying to add on my learner app is the bottom navigation but I'm getting the error when I build the project:
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.asussonicmaster.nonameapp"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.roughike:bottom-bar:1.2.1'
}
What am I doing wrong here,
Error:Execution failed for task ':app:processDebugManifest'.
Error: [C:\Users\ASUS Sonic Master\AndroidStudioProjects\NoNameApp\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.2.0\AndroidManifest.xml:21] Invalid instruction 'overrideLibrary', valid instructions are : REMOVE,REPLACE,STRICT
It's better to keep the build version, compile version and the google libs at the same version.
Try this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.asussonicmaster.nonameapp"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.roughike:bottom-bar:1.2.1'
}
When I run my project, it shows the error in the title. What is the solution?
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.bangloss.boss.myapplication"
minSdkVersion 10
targetSdkVersion 24
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.1.1'
compile 'com.android.support:design:24.1.1'
}
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 am trying to test my app on SDK 17 . Android studio error Failure [INSTALL_FAILED_OLDER_SDK] Here is my android manifest:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.sample.exams"
minSdkVersion 17
targetSdkVersion 22
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:22.0.0'
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:support-v4:22.1.1'
compile project(':library')
}
Solved
Finally I solved it. You can find my code Here
This is specific to this lib. I want detail explanation on how to add it in my project and use either of zxing or zbar.
As instructed compile 'me.dm7.barcodescanner:zxing:1.7'
is giving gradle project failed while syncing.
I have added that lib inside libs/barcodescannerLIB
settings.gradle
include ':app'
include ":libs:barcodescannerLib:core", ":libs:barcodescannerLib:zxing:zxing", ":libs:barcodescannerLib:zxing:sample", ":libs:barcodescannerLib:zbar:zbar", ":libs:barcodescannerLib:zbar:sample"
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.dxd.testbs"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/libs'] } }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile project(":libs:barcodescannerLib:core")
compile project(":libs:barcodescannerLib:zxing:zxing")
compile project(":libs:barcodescannerLib:zxing:sample")
compile project(":libs:barcodescannerLib:zbar:zbar")
compile project(":libs:barcodescannerLib:zbar:sample")
}
Add in your build.grandle file the support dependence:
dependencies {
compile 'com.android.support:support-v4:19.+'
}