Android Studio components aren't displaying and app does not run - android

I am new to Android Studio and want to know why it does not really work for me.
Basically, I just started learning Android Studio watching an online course, so I am just doing the same thing what the lecturer does on the videos, but the result never turns out the same.
Firstly I want to let you know that I have not touched anything. But Android Studio does not show any of components, such as textView, and when I run it, the ADB(the Emulator) never runs the app but only shows the default screen of an Android phone.
I better attach some screenshots of my Android Studio to show you what is going on.
As you can see from this picture, there is a textView component but it does not appear on the screen that is in the center.
As I wrote above, I did not touch anything. It is just right after I create a new project. No matter what component I add, it never shows up.
I have no idea if it would matter but if you look at the top right, an error occurs (red exclamation mark) that is saying "Render Problem: Failed to load AppCompat ActionBar with unknown error".
I have tried to solve this error for several hours and could not really find a solution to this too.
And when I run the app (by pressing green arrow button), here's what happens.
It just stays on this screen. Nothing really happens after this.
What should I do to see my components and to make it run the app? What am I missing? I really have done exactly the same as the online course I am watching and I see no one is having the problem I am facing now.
Any help?
In case of it will be needed, I am uploading both of my gradle files too:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is a gradle file build.gradle (Project: project name)
And the following is a gradle file build.gradle (Module: app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.auclo.exampleapp"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
And styles.xml
Thanks.

This is an issue of version 28, you should downgrade to version 27 until the problem is solved.
Go to your app/Gradle Scripts/build.gradle (Module:app)
1
Change this line:
compileSdkVersion 28
to
compileSdkVersion 27
2
Change this line:
targetSdkVersion 28
to
targetSdkVersion 27
3
Change this line:
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
to
implementation 'com.android.support:appcompat-v7:27.1.1'
Then Android Studio will ask you to Sync the files, and you do so by clicking in Sync Now
Keep learning how to code, and soon Android will solve this problem. You can see more about this discussion here.

I wanted to wait till i'm clear but since everyone is telling him to downgrade the project, here I go.
There's a bug in the newer versions. So if you want to run your project on sdk 28, in your res/values/styles.xml modify the AppTheme style from
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
to
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
Basically waht you have to do is add Base to whatever is already there.
Or
As the others said you can downgrade your project to:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
But I think you should always learn on the latest so you're free to choose either options :)

Go to styles.xml and change
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
to
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">

Change Depandency
This is an issue of version 28, you should downgrade to version 27 until the problem is solved.
compileSdkVersion 28 to compileSdkVersion 27
targetSdkVersion 28 to targetSdkVersion 27
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
replace with
implementation 'com.android.support:appcompat-v7:27.1.1'

Related

Android Studio Gradle Build failing - asking for a sdk version that doesn't exist

24 hours ago my project built perfectly, no errors. Without changing a single piece of code, it will no longer build when I have resumed work.
Checking out to older working commits now produces the same error.
These are the error codes I get:
Information:Gradle tasks [assemble]
Error:(9, 5) error: resource android:attr/dialogCornerRadius not found.
/home/liam/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0-alpha1.aar/536e4dd78846259cf8bef0fd6a3ea0e6/res/values/values.xml
I think that this has been caused by Android P being released and my Android Studio automatically upgrading or something like that. Which would explain why old commits that worked get this same error.
This would be a very new issue, which would explain why I cannot find a solution to it yet.
Searching these error codes leads to a similar issue that was resolved by changing the SDK version in the gradle build file. My problem differs from this because changing to SDK 28 (I'm pretty sure 28 doesn't even exist) leads to android studio saying this package isn't available/doesn't exist for download.
How to find issue Android SDK 3.0 Error:(9, 5) error: resource android:attr/colorError not found
Clicking on the first mentioned error codes leads to a file called v28/values-v28.xml being opened.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Base.Theme.AppCompat" parent="Base.V28.Theme.AppCompat"/>
<style name="Base.Theme.AppCompat.Light" parent="Base.V28.Theme.AppCompat.Light"/>
<style name="Base.V28.Theme.AppCompat" parent="Base.V26.Theme.AppCompat">
<!-- We can use the platform styles on API 28+ -->
<item name="dialogCornerRadius">?android:attr/dialogCornerRadius</item>
</style>
<style name="Base.V28.Theme.AppCompat.Light" parent="Base.V26.Theme.AppCompat.Light">
<!-- We can use the platform styles on API 28+ -->
<item name="dialogCornerRadius">?android:attr/dialogCornerRadius</item>
</style>
</resources>
Here are my gradle files:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.timelord.timelord.timelord"
minSdkVersion 24
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation files('libs/joda-time-2.9.9.jar')
}
And
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You have the design lib version with + in your build.gradle which means it will download the latest version. So please set it to 26.1.0 and it should work. The support 28 is in alpha and was released yesterday with the new android P preview
Make sure in your app's build.gradle you have these:
dependencies {
compile 'com.android.support:support-v13:27.+'
compile 'com.android.support:design:27.+'
}

Failed to find style 'coordinatorLayoutStyle' in current theme

I'm using the latest version of android studio (3.0), along with latest build tools (27) and similar API level.
The layout does not get rendered in the design tab and it's causing a lot of trouble especially that I'm using coordinator layout.
How do I get around this problem?
I solved this rendering problem by simply inserting this line into the application theme (the app theme is usually placed in styles.xml).
[SDK 28]
<style name="AppTheme">
<item name="coordinatorLayoutStyle">#style/Widget.Support.CoordinatorLayout</item>
</style>
[SDK 27]
<style name="AppTheme">
<item name="coordinatorLayoutStyle">#style/Widget.Design.CoordinatorLayout</item>
</style>
As suggested by #Chris. If the IDE does not find the CoordinatorLayout in Widget.Support or Widget.Design, just start typing "CoordinatorLayout" and it should give you some options.
Turns out the new SDK 28 is unfortunately introducing this error on Android Studio when you create a new project.
How to solve:
Check your build.gradle (Module: app) file and change:
compileSdkVersion 28
targetSdkVersion 28
To:
compileSdkVersion 27
targetSdkVersion 27
Also, make sure you are using the right dependencies version:
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3' in
build.gradle(module) change alpha 3 to alpha 1. sync and you should be good to go. I spent almost a day trying to figure this out. none of these answers worked for me. hope this helps
I was also facing the same problem. Nothing like changing theme from Layout preview window helped me.
Solution: I updated my build.gradle(app) with:
dependencies {
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
}
One more thing:
compileSdkVersion 27
targetSdkVersion 27
<style name="Theme.Shrine" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="coordinatorLayoutStyle">#style/Widget.Support.CoordinatorLayout</item>
</style>
Add in your material theme.
For Android Studio 3.1.4 users:
I've tried marked answer but it didn't work for me.
Inserting this line:
<style name="AppTheme.NoActionBar">
<item name="coordinatorLayoutStyle">#style/Widget.Design.CoordinatorLayout</item>
</style>
into the application theme doesn't solve the rendering problem so I've undone that change.
Solution:
I've made this changes in my build.gradle(Module:app) file:
Before change:
android {
compileSdkVersion 28
defaultConfig {
targetSdkVersion 28
}
}
}
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
}
After change:
android {
compileSdkVersion 27
defaultConfig {
targetSdkVersion 27
}
}
}
dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
}
It worked for me perfectly. Hope that will be useful.
Thanks for the response, I found the solution tinkering with the code,
I had tools:showIn attribute enabled in the parent layout of a fragment, which I moved to a viewpager, it was previously embedded in a host activity, lint did not catch it though, which is a bit surprising.
I think it is a common issue in android studio 3.0+,
Hopefully they will fix it next update. In the Android Studio Preview 3.2 it works fine.
Download Android Studio Preview
As an aside, in design view of Android Studio, if I add the following to the styles.xml file:
<style name="Coordinator">
<item
name="coordinatorLayoutStyle">#style/Widget.Design.CoordinatorLayout</item>
</style>
and add the following to the CoordinatorLayout in the layout's xml resource file
<android.support.design.widget.CoordinatorLayout
android:theme="#style/Coordinator"
android:orientation="vertical"
android:id="#+id/sample_layout_id"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/sample_background"
tools:theme="#style/Coordinator">
then, at least, the design view stops generating the missing coordinatorLayoutStyle error.
My Android studio version 3.1.3.
i'm worked with uninstall ALL SDK version 28. Step is Open SDK Manager > SDK Platforms > Show package Details > Untick SDK 28 > apply and Create new project.
I have the same problem but on the Android studio 3.1.4
So, at first I have done the following in build.gradle
Replace this:
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:support-v4:28.0.0-rc01'
with that:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:design:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'
But somehow after project rebuild the problem repeats again.
So, I have go this way:
Here is my project gradle.build
buildscript {
ext.kotlin_version = '1.2.41'
ext.android_support = '27.1.1'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And here app build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 27
defaultConfig {
applicationId "*****.******"//Replace with your own ID
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
And this solve my problem
Thank you
I will post an answer The other answers may work but no one should need to download Preview Version and doing Material Design with no Action Bar is not the way to START developing apps with Android Studio
Our version of Android Studio is 3.1.4
Our default API is 28
Our FIX is to downgrade to API 26 YOU do this by clicking File -> Project Structure then highlight app Under the Properties TAB Change Compile Sdk version to API 26 Now click on the Falavors TAB and change Target Sdk version to 26
Then in build.gradle(module:app) add these changes
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
I guess one could always justify this slow FIX by Google to learn to use the ToolBar
This maybe existing issue: https://issuetracker.google.com/issues/37048767
Render using other versions of Android (say Android API 22).
Or check for any typos or invalid XML entries.
Refer here: Missing styles. Is the correct theme chosen for this layout?
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="coordinatorLayoutStyle">#style/Widget.Design.CoordinatorLayout</item>
</style>
just add coodrinatorLayoutStyle as an item in style.xml and it worked for me.
Just Change implementation 'com.android.support:appcompat-v7:28.0.0-alpha3' and
'com.android.support:design:28.0.0-alpha3' to alpha 1.
That's how i solved the problem.
I solve this problem when update all SDK tools in IDE and update Android Studio to 3.2.1
its working for me try it
compileSdkVersion 28
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
}
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
This is sdk 28 issue
Check your build.gradle (Module: app) file and change:
compileSdkVersion 28
targetSdkVersion 28
To:
compileSdkVersion 27
targetSdkVersion 27

Toolbar: IllegalStateException - configure your build for VectorDrawableCompat

I'm using Android Studio 2.1.2. I started a new project with minSdkVersion as 19. My activity extends AppCompatActivity. The project starts with an empty activity using a fragment.
When previewing content_main.xml with API 24, all is good. when previewing API 19, I get the following rendering problem:
The following classes could not be instantiated:
- android.support.v7.widget.Toolbar
java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat
I have added every thing I found relevant to the gradle (2 files):
classpath 'com.android.tools.build:gradle:2.1.2'
vectorDrawables.useSupportLibrary = true
buildToolsVersion "24.0.1"
compile 'com.android.support:appcompat-v7:24.1.1'
compile "com.android.support:support-v4:24.1.1"
compile 'com.android.support:design:24.1.1
But still the error appears. I've found a lot of answers on internet. But none helped. Is there a problem using the new toolbar with API 19?
This worked well for me
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
generatedDensities = []
}
// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Notice this in the above code:
// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
}
and
generatedDensities = []
from this google Issue
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
check this issue for more help.
UPDATE
configured your app build.gradle file as follows
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.3.0'
}
Source
Age Of Vectors
Firstly, there are two types of gradle files.
build.gradle(Project: ProjectName)
build.gradle(Module: app)
For more information on these two files, go through this answer.
Coming to your question,
I've found a lot of answers on the net but none helped. I'm using
Android Studio 2.1.2, my activity extends AppCompatActivity and added
to the gradle (2 files) every thing I found relevant: but still the
error appears.
From whatever you have posted, it seems like you didn't add right things at right places.
You shouldn't place your application dependencies in build.gradle(Project: ProjectName) - Android Studio says,
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Hence, replace your dependencies in build.gradle(Project: ProjectName) with below
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
Replace your dependencies in build.gradle(Module: app) with below
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'
}
After doing as mentioned above, you will see a "Sync Now" option on the Top Right. Click it. Android Studio will take care of remaining things.
Also this question similar is to yours. Go through it. It may help.
Add :
build.gradle
defaultConfig {
...
vectorDrawables.useSupportLibrary = true
...
}
And on top of your Activity class:
static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
And one last thing put your vector drawables inside any other drawables like selector, LayerList, etc. Something like below:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#drawable/drawable_vector" />
</selector>
And use this above drawable everywhere instead of setting vector drawables directly. This will at other places as well whenever you want to use vector drawables on pre-lollipop devices.

Android - Changing compileSdkVersion leads to errors

I am using Android Studio 1.2.2 to develop an Android Application. In my build.gradle file, I have defined the compileSdkVersion to 21 since the beginning of the work. Now I wanted to change that to 19, since this software actually will never be installed on an Android device, that runs a higher version than Android 4.4
When I try to change this value to 19, the project does not compile anymore.
After the change of the version value I have:
synced the project
cleaned the project
rebuild the project (tried)
But the following error occurs:
In the file /projectpath/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/res/values-v21/values-v21.xml it marks 103 errors, saying "cannot resolve symbol".
values-v21.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/lmp-mr1-supportlib-release/frameworks/support/v7/appcompat/res/values-v21/styles_base_text.xml -->
<eat-comment/>
<style name="Base.TextAppearance.AppCompat" parent="android:TextAppearance.Material"/>
<style name="Base.TextAppearance.AppCompat.Body1" parent="android:TextAppearance.Material.Body1"/>
<style name="Base.TextAppearance.AppCompat.Body2" parent="android:TextAppearance.Material.Body2"/>
<style name="Base.TextAppearance.AppCompat.Button" parent="android:TextAppearance.Material.Button"/>
....
cannot resovle symbol android:TextAppearance.Material
cannot resovle symbol android:TextAppearance.Material.Body1
cannot resovle symbol android:TextAppearance.Material.Body2
cannot resovle symbol android:TextAppearance.Material.Button
and so on...
What is causing this error? What can I do to make it compile again?
When I change back the compileSdkVersion to 21, everything works normal again.
My build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '23.0.0 rc3'
defaultConfig {
applicationId 'com.appname.id'
minSdkVersion 17
targetSdkVersion 19
versionCode 1
versionName "0.0.2 Alpha"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}
to use appcompat-v7:22.2.0 you have to compile against API 21. There's no harm in doing it, even if it will never run on devices running 21.
You can try some older version of the app compat, but then you will be missing in "cool new features" and bug fixes from the latest app compat.
If this might help someone, after MANY trials and errors, I found that I was targeting the wrong SDK version (an older one) in the build.gradle file corresponding to "library". To change this you can do it by hand or go to the Module Settings Menu (right click on your project folder -> Open Module Settings. Then in "library" - Properties you can change the Compile Sdk and the Build Tools Versions
make sure you have installed API 19 in sdk manager

AppCompat / Chromecast in Android-L Preview

Situation:
I'm currently building a new version of my app for Android L and am also in the process of Chromecast integration.
The app works fine, as long as I extend Theme.Material with my custom style, but doesn't show the Cast button.
Problem:
As soon as I change to Theme.AppCompat, it gives me the error:
Error:Error retrieving parent for item: No resource found that matches the given name '#android:style/Theme.AppCompat.Light.DarkActionBar'.
and the same goes for the the Holo Theme as well.
Here's my build.gradle (The libs folder is empty btw.):
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.myapp.myapp"
minSdkVersion 'android-L'
targetSdkVersion 'android-L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// You must install or update the Support Repository through the SDK manager to use this dependency.
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v4:+'
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:mediarouter-v7:+'
compile 'com.google.android.gms:play-services:+'
}
Here is the relevant part of the values/styles.xml:
<style name="SK" parent="android:Theme.AppCompat.Light.DarkActionBar">
used to work with Theme.Holo.Light.DarkActionBar
and the values-v21/styles.xml:
<style name="SK" parent="#android:style/Theme.AppCompat.Light.DarkActionBar">
used to wirk with Theme.Material.Light.DarkActionBar
I already cleaned and rebuild the project, but it always goes back to showing me errors about a missing parent.
As far as I could gather from similar questions, all relevant libraries are included and all use the newest version available.
I also tried manually adding the libraries to the libs/ folder with no success.
My SDK manager shows that everything is installed and up to date.
What am I missing here?
Thanks in advance for your time.
Solution:
It was actually rather simple. I referred to Theme.AppCompat with the android namespace, but should have left it out, so, instead of
#android:style/Theme.AppCompat
it should be
#style/Theme.AppCompat
This did show another error initially, about "Theme" not being found, but it compiled non the less.

Categories

Resources