How do I use android.support.transition? - android

I want to run my app, which uses transitions on an android device with Jelly Bean 4.2.2, API 17. In the build.gradle:app targetSdkVerion is set to 24, minSdkVersion to 16.
When launching the app on my device I get the error Could not find class android.transition.Transition
On Android Developers theres a package called android.support.transition mentioned, but I don't know how to use it, when I insert it in my build.gradle I get an error, "Could not find com.android.support:transitions:24.1.1.
Do I need to change the values, and if so, how?
My build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "user.example"
minSdkVersion 16
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'
compile 'com.android.support:transition:24.1.1'
}

You need to download or update support library from SDK Manager. This is link from Android Developer website :
Setup Support Library
Then you can use the support transition library. Note that if you want to use the TransitionManager class from this support library, be sure to import the support library version ('android.support.transition.TransitionManager')

Related

google maps api sdk version error?

It's my code sample. When I firstly build my code, it results in so-called dex error. I added multiDexEnabled property to my gradle setting, but it results in java heap memory overflow. I increased its max size, and finally got builded. However, another error occurred...... what is the problem? android adk version?
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "belobster.earthquakealert"
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "2g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.google.android.gms:play-services:9.6.1'
}
emulator image.
Check whether play services is available on the emulator, you should consider using physical device for these kind of testing purposes since maps require location services quite often.
download gapps-lp-20141109-signed and install in genymotion
If you want to test it into Genymotion only then , Genymotion provide support for play service
So please check it. It's work for me.
Thank you.

Is it possible to add older version com.android.support:appcompat-v7 in android studio?

How can I add the com.android.support:appcompat-v7 for android version 7.
Android studio forces me to set the compile version to 22.1.1,
but when the project doesn't compile.
I have to set the compile version and the target version to 7,
cause otherwise some functionality doesn't work.
My build-gradle look like this:
apply plugin: `'com.android.application'`
android {
compileSdkVersion 7
buildToolsVersion "23.0.0 rc2"
defaultConfig {
applicationId "com.example.ella.pulltorefreshexample"
minSdkVersion 7
targetSdkVersion 7
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.1.1'
}
Thanks!
How can I add the com.android.support:appcompat-v7 for android version 7
There was no version 7. The oldest is 18.0.0, and the 21+ editions are significantly different than the ones prior to that.
I have to set the compile version and the target version to 7, cause otherwise some functionality doesn't work.
Then you need to fix the functionality in your app (so that you can use a higher compileSdkVersion and a realistic targetSdkVersion), or not use appcompat-v7.

Android TV INSTALL_FAILED_OLDER_SDK

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.

Android missing layout_alignParentStart after upgrade

I upgraded from Android Studio 0.5 to 0.8
now I have heaps of issues, I resolved most of them but now I get this error
Error:(12) No resource identifier found for attribute 'layout_alignParentStart' in package 'android'
I dont know why it does not have layout_alignParentStart anymore?!
am I missing something here?
I had the same issue, my problem was the compileSdkVersion, I changed from 16 to 20 and it works.
I give you my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "mypackage"
minSdkVersion 15
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'])
compile 'com.android.support:appcompat-v7:20.+'
// You must install or update the Support Repository through the SDK manager to use this dependency.
// You must install or update the Support Repository through the SDK manager to use this dependency.
compile 'com.android.support:support-v4:20.+'
// You must install or update the Support Repository through the SDK manager to use this dependency.
compile 'com.android.support:support-v13:20.+'
}
Since API level 17, android has some new attributes for RTL layout such as:
layout_alignParentStart
layout_alignParentEnd
layout_alignStart
layout_alignEnd
layout_marginStart
layout_marginEnd
however some devices has special ROM which may not support these attributes and leads exception
Remove all these *Start /*End attributes can fix the issue

Android Studio minSdkVersion not working

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

Categories

Resources