I am using RatingBar in android and want to reduce the size of it , so I added
style="?android:attr/ratingBarStyleSmall"
as Ratting Bar Style attribute. It is working fine but it is showing error in code
below is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion " 22.0.1"
defaultConfig {
applicationId "com.app.xxxx"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
} }
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(path: ':vitamio')
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:support-v4:22.2.1'
}
Please help what I am doing wrong..
Thanks In Advance..
Use this instead style="?attr/ratingBarStyleSmall"
Related
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '26.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "org.passitonkentucky.fayetteresources"
minSdkVersion 18
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.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.android.support:multidex:1.0.2'
}
I downloaded Android 3.0.1, before this I had error minimum version 3.0.
When that's resolved, it's now showing me error.
(27,4).
How can I solve this problem?
First you should avoid using "+" in version number its bad practice. add version number will solve your problem.
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
So I am getting this error when I add this library in my gradle file.
compile 'com.miguelcatalan:materialsearchview:1.4.0'
This is my gradle file
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.gnr.kumar.varun.songapp.songapp"
minSdkVersion 16
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.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.android.support:support-v4:22.2.1'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
}
How can I prevent this, can anyone please suggest something ?
'android:TextAppearance.Material.Widget.Button.Inverse'
You should change your compileSdkVersion
compileSdkVersion 23 // compileSdkVersion is the version of the compiler used in building the app
buildToolsVersion "23.0.1"
Then Clean-Rebuild-Sync Your App .
Am new to retrofit, I have used retrofit in my project which was working fine upto now for all version of my required devices. but after adding a library module to my project it runs on only higher versions like 22 v and prompts an error this:
Could not find class 'retrofit.Utils$SynchronousExecutor', referenced
from method retrofit.RestAdapter$Builder.setExecutors
java.lang.NoClassDefFoundError: retrofit.RestAdapter$LogLevel
on lower versions like 14 v .
my app gradle is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.risingkashmir"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
// compile fileTree(dir: 'libs', include: ['*.jar'])
// compile 'com.android.support:support-v4:22.0.0'
//noinspection GradleDependency
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.nineoldandroids:library:2.4.0'
compile project(':library')
compile files('libs/universal-image-loader-1.9.4.jar')
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile project(':librarymenu')
}
and my library Gradle is:
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "v0.1L"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// compile 'com.balysv:material-ripple:1.+'
// compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:appcompat-v7:23.2.0'
}
I'm trying to use the method findFirstVisibleItemPosition() from a LinearLayoutManager. The apis show that this method exists, but it is not recognized nor shown in autocompletion.
Other methods from this layout work (some at least), and android.support.v7.widget.LinearLayoutManager is imported.
What could be wrong?
edit: hereĀ“s my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.skate.socialskate"
minSdkVersion 21
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.google.android.gms:play-services:7.0.0'
compile 'com.android.support:cardview-v7:22.1.0'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.android.support:support-v13:22.1.0'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
compile 'org.jsoup:jsoup:1.8.2'
}
You need to add an appcompat to your build.gradle:
compile 'com.android.support:appcompat-v7:22.1.1'
I know this question was asked several times, but none of the answers helped me so far...
All I did was generating a preferences screen with Android Studio and now it tells me that NavUtils cannot be found. Even though my build.gradle looks right (I guess):
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '20.0.0'
defaultConfig {
applicationId "com.brobox.getyourshitdone"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName '1.0'
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:palette-v7:+'
compile 'com.android.support:support-v4:20.0.+'
compile files('libs/android-support-v4.jar')
}
I hope someone can help :/
Edit:
Just created a new project on my laptop and generated the SettingsActivity again. This is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.brobox.getyourshitdone"
minSdkVersion 14
targetSdkVersion 19
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:support-v13:20.0.0'
compile 'com.android.support:support-v4:20.0.0'
}
Still got the same error <.<
You have to remove this line implementation files('libs/android-support-v4.jar') and you have to remove this file.
The support library should only be added by gradle. And you have done that in this line implementation 'com.android.support:support-v4:20.0.+'.
YourtargetSdkVersion and your compileSdkVersion are also weird. Those values are not supported with the L developer preview.
compileSdkversionshould be 'android-L', targetSdkVersion should be 'L'.
Press this button, and clean rebuild project.
And add to dependencies :
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:palette-v7:+'
}
Well some time passed and now it works! I don't know what solved it exactly but I did the following:
I updated to Android Studio 0.8.12 manually, because that was the only way to update it
In a new project I tried to manually add a SettingsActivity and therefore added support-v4 to my repositories
Thanks for all your help on this silly question...