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')
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 and i want to use Marshmallow API and AppCompatActivity. When I created a new project the build.gradle contained the below lines but I receive error at R class which says not a symbol.
Please let me know how to correct the build.gradle to get the App work.
gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.com.myapplication"
minSdkVersion 19
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'
}
Click on Build->Clean Project and that will perform a gradle clean
Update your Android SDK Manager Install all component of Android 6.0 (API 23)
R file can be erased due to many reasons, try rebuilding your project(which is the most common issue) and other issues may include any syntax error or inappropriate file permissions in work space, the exact error report can help address the issue better.
I'll start from what I want to achieve: building the googlecast-manager example provided here: https://github.com/googlecast/GameManagerSamples
I followed instructions here: https://developers.google.com/cast/docs/android_sender
So first I downloaded from github the project, then with the Android SDK Manager I downloaded Android Support Libraries and Google play Services. Then in my project, I went to "Open Modules Setting->Add" then went to "Android SDK\extras\android\support\v7\appcompat" and added it.
Then first step to ensure it's working is to build it. So I right clicked on appcompat->"Compile Module Appcompat" but it fails with 2 errors:
Error:(20, -1) android-apt-compiler: [appcompat] D:\Android
SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20:
error: Error retrieving parent for item: No resource found that
matches the given name 'android:Widget.Material.Button.Colored'.
Error:(19, -1) android-apt-compiler: [appcompat] D:\Android
SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base_text.xml:19:
error: Error retrieving parent for item: No resource found that
matches the given name
'android:TextAppearance.Material.Widget.Button.Inverse'.
Doing the same for Google Play works like a charm.
I've tried to find videos/other similar issues but it's either too complicated or not my problem.
Here is the AndroidManifest.xml of appcompat:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.v7.appcompat">
<uses-sdk android:minSdkVersion="9"
android:targetSdkVersion="19"/>
<application />
Here is what is installed from the Android SDK Manager:
I also encountered the same problem and now have fixed it. What you just have to do is
Inside your Android Studio
press Shift button two times, a search box will appear type build.gradle
choose build.gradle module:app from the suggestion.
major version of compileSdkVersion and support libraries under dependencies should be same as following code depict.
Inside Eclipse
find build.gradle module:app and do the same.
Note: download and install properly the latest API which is now API 23.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.inzi.app"
minSdkVersion 9
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.0'
}
I believe you should upgrade your compileSdkVersion. Check your build.grade file, should be something like:
android {
compileSdkVersion 23 // <- here
buildToolsVersion "23.0.0" // <- here
defaultConfig {
applicationId "your.id"
minSdkVersion 11
targetSdkVersion 23 // <- and maybe here
versionCode 1
versionName "1.0"
}
buildTypes {
....
}
}
Of course you will need to download the newest Android SDK and build tools (and whatever else you need) from the SDK Manager.
If you are working in Eclipse do the following:
In your AndroidManifest.xml file change android:targetSdkVersion to 23
Open Project settings (ALT + Enter while focused in Project Explorer)
Go to Android tab and in Project Build Target section mark Android 6.0
Clean and build your project
NOTE: when you do this have in mind that Android OS would treat your app as if it was designed to work on Android M. So for example if you use some dangerous permissions you should add routines to check then on runtime.
You have to update your SDK to the API 23 that is either not downloaded or not installed properly.
In your build.gradle set
compileSdkVersion 23
buildToolsVersion "23.0.0"
targetSdkVersion 23
compile 'com.android.support:appcompat-v7:23.0.0'
I actually found the answer for my problem and the person above was right. The Module SDK set to compile the module was 22.0 and not 23.0. To fix that I did the following.
Right click on appcompat: "Open Module Setting -> Modules SDK": New. I Chose the folder containing the whole Android SDK and chose the last Android (e.g. 6.0) with the last Module SDK 23.0.
Either revert to appcompact-v22 or update to android api v23
You have to update your SDK to the API 23 that is either not downloaded or not installed properly.
Make sure your compileSdkVersion and dependencies version should be same.
I was having problem with new appcompat V-23 as my target sdk is 21. So I did following two steps and it works perfectly for me..
1) Delete the values-23 folder in res folder.
2) I was getting error on the src folder as well, so commented the only line inside main() of snippet.java as we do not require it.
Then add this project as library to your project.. Hope it helps.
I resolved like below
android {
compileSdkVersion "Google Inc.:Google APIs:21"
buildToolsVersion "23.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
}
replaced the above dependencies with below...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:7.8.0'
}
To correct this error in android studio procceded like this :
i went to sdk manager and i downloaded and updated all packages of android api 23
file => project structure and i changed compile sdk version from 21 to 23 and build tools version from 21 to 23
The problem generally occurs due to version issues. The following dependencies and compilesdkversion Worked for me:-
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:support-v13:23.0.+'
compile 'com.firebase:firebase-client-android:2.2.4+'
}
The answer #31 & #11 in this discussion can solve this issue:
https://code.google.com/p/android/issues/detail?id=183122
My issue was, one of my un-used dependencies was using sdk-23 version. So after removing those un-used dependencies it worked like a charm.
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.