Hello developers friends!
I am studying development for Android in recent months.
But just this last week came the question . How can I solve the problem of the image below ?
ActionBar is deprecated in the latest android api... If you need to use it make sure your theme read as follow:
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
you can find this in:
res > values > styles.xml
I was also getting these errors.
Solved by setting similar versions to the fields in gradle file as below
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.intplus.hijackid"
minSdkVersion 16
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.0'
}
Observe the versions compileSdkVersion, buildToolsVersion, targetSdkVersion also the support v7 version.
I was having appcompat-v7:21.0.3. Changes as shown above fixed the issues!
Related
I keep getting the a error after trying to add a library to my project, however all i did was cause a error.
Error:The SDK Build Tools revision (19.0.0) is too low for project ':library'. Minimum required is 19.1.0
I have read up on the problem but what they suggest i have already done such as changing the version shown below to one above, but they have always been as shown below.
compileSdkVersion 23
buildToolsVersion '23.0.2'
I thought it could have been the minimum version so i change it but still no change.
minSdkVersion 23
targetSdkVersion 23
Both of them are above the required version yet i keep getting the error, any ideas on what is causing the error?.
The problem still occurs after i have removed the library i was trying to import now i am just left with an error that wasn't there before.
Thanks in advance.
Edit:
Gradle File
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "quiz.quiz"
minSdkVersion 23
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.readystatesoftware.sqliteasset:sqliteassethelper:+'}
Go to your SDK Manager and update your SDK Build Tools. See if that works. This is how mine looks.
i am using Android studio 1.5. and at when i click run i receive
unable to determine package name
i checked the manifest file and it is as shown in the image below...but i do not know why the activities are marked with red even the app name and the icon
as well.
please let me know how to fix this
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.com.bt_11"
minSdkVersion 21
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'])
compile 'com.android.support:appcompat-v7:23.0.1'
}
I followed the same steps as user2121 and eventually tried downgrading to Android Studio 1.4.1. Unlike user2121, I still got an error, however it was different than when on 1.5.1.
AndroidManifest.xml file not found
Upon searching for this new error, I found this StackOverflow answer which solved the problem for me on 1.5.1 as well as 1.4.1.
I learned from Android SDK sample SwipeRefreshListFragment
and tried SwipeRefreshLayout/ListFragment in new test app by using support-v4
I found a difference:
in offical sample, SwipeRefreshListFragment Loading style is a rotating circle, but in my test app, loading style is a colorful line on top of the fragment
i tried to change gradle config both minSdkVersion and targetSdkVersion to 21 (set to 14 before), but still the old style.
Is there any version config caused this diff?
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.weibo.biz.tongji"
minSdkVersion 21 targetSdkVersion 21
} buildTypes {
release {
minifyEnabled false proguardFiles
getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile files('libs/android-support-v4.jar')
compile 'com.mcxiaoke.volley:library:1.0.11'
}
remove
compile files('libs/android-support-v4.jar')
and add
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v4:+'
and you should get the rounded style
I am trying to test out an Android TV app on my TV. It works in the emulator and I am using Android Studio 0.8.14.
My build.gradle file is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "kgibilterra.com.tvgame"
minSdkVersion 21
targetSdkVersion 21
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:recyclerview-v7:21.0.0'
compile 'com.android.support:leanback-v17:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.squareup.picasso:picasso:2.3.2'
}
I have everything installed in the SDK Manager and in AndroidManifest.xml I have
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21"/>
Has anyone else figured this out with AndroidTV specifically?
INSTALL_FAILED_OLDER_SDK you are facing means device you are trying to install your app on, is running lower version than required in your Manifest's android:minSdkVersion. I am almost sure your app is not requiring Lollipop to run, so you need to edit your Manifest and set these values correctly.
See docs: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
change the minSdkVersion value to 19. The issue will solved.
The minSdkVersion directive in my build.gradle appears not to be working (Android Studio 0.8.2)
Here's the build.gradle for the "mobile" module:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.android.support:appcompat-v7:20.+'
compile 'com.google.android.gms:play-services-wearable:+'
}
When I try to debug it on my Samsung Galaxy S4 (API 19) I see this message in the "Compatible" column:
"No, minSdk(API 20) > deviceSdk(API 19)"
Minimum SDK should clearly be 9 as specified by the build.gradle. If I try to launch it anyway I get:
"Failure [INSTALL_FAILED_OLDER_SDK]"
I've scoured this project for any indication of something that could force the minSdk to 20. Nothing in AndroidManifest.xml. This project is a wearable app.
I've built another wearable app on the same machine and it loads and runs on the Samsung without a problem. This app that I'm trying to use was put together by a friend. It has only a small amount of code. The build.gradles are identical.
Totally baffled. Please help!
Android L version (SDK 20) will be overrides minSdkVersion to 20. You should change your build version to 19 or below version of SDK. for example,
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
applicationId "example.myapplication"
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-v4:19.+'
}
Modify your build.gradle file like this, and resync your project and rebuild it.
also you should install 19.1 sdk libraries to using SDK Managers. Run android studio as administrator will be help to solve another problems when you install sdk and rebuild your project.
you can change compileSdkVersion 20 to compileSdkVersion 16 to have a try ,it works to me