How to resolve Theme.AppCompat.Light error - android

I am facing a issue after run existing android studio project. Please check error below and let me know how to resolve that.
Error:(54) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
Thanks in advance

Try to use accroding gradle plugin. I've got the problem with plugin 2.3-beta1 and Studio 2.2.3, when changed to plugin 2.2.3 - everything worked like a charm

Please change compileSdkVersion and buildToolsVersion in your gradle file according to your android studio existing running project.

Our compile SDK version must match the support library's major
version.
If you are using version 23 of the support library, you need to compile against version 23 of the Android SDK.
Alternatively you can continue compiling against version 22 of the Android SDK by switching to the latest support library v22.
You can either change it manually in your build.gradle, or you can use
the GUI by opening up the project properties and going to the
"dependencies" tab.
Or Press Ctrl + Shift + Alt + S to get to the project structure page. Go to the properties tab and change version to 23.0.0 or whatever latest in the build tool area and rebuild your project.
If that doesn't work, go to gradle:app and then
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
Edit version as shown above and sync gradle.

Ran into same issue as OP, March 2017 Android Studio 2.3.
My build was working fine for months, and this issue came up right after adding a new line to gradle build file. Ultimately making some changes in Gradle and re-sync'ing fixed the issue, but my Gradle ended up being exactly the same as when the issue first came up, strangely.
My original Gradle build dependencies:
compile 'com.android.support:design:25.1.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:gridlayout-v7:25.1.1'
compile 'com.android.support:cardview-v7:25.1.1'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'com.google.android.gms:play-services-location:10.0.0'
compile 'com.google.android.gms:play-services-maps:10.0.0'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.4'
Then, I simply added a new line:
compile 'org.scribe:scribe:1.3.5'
This is when the issue appeared, same as OP.
I saw red errors in my styles.xml and wondered "wtf?".
Cleaning and re-building had no affect.
Going back to the Gradle build file, I commented-out that new line. ISSUE RESOLVED! So obviously there was something going on.
For fun, I put that line, uncommented, at the top of this compile list. NO ISSUE!
For fun yet again, I put that line back again to the bottom of the list (like how originally added it). NO ISSUE.... weird!
How Gradle sync'ing responds doesn't seem to be 100% consistent. I did no other changes to my project. All I can say is try toggling and re-ordering things in the compile list.

Related

Facebook SDK Causes Warning in app Gradle File (Android Studio)

I am using the following dependency
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:design:${rootProject.ext.supportLibVersion}"
Where the ${rootProject.ext.supportLibVersion} part refers to the value "25.3.1". Now the issue is that Gradle says that there is a conflict due to the existence of multiple versions of the same support library (specifically 25.0.0 and 25.3.1). I run the Gradle dependency tree task and viewed it. I finally found the conflict and it's caused by the Facebook SDK which uses the following:
com.android.support:cardview-v7:25.0.0
com.android.support:customtabs:25.0.0#aar
How to solve this conflict? I know the app is working and everything but a crash may happen in runtime. I also want to get rid of the warning in the Gradle file.

compile 'com.android.support:multidex:1.0.1' happened wrong: all com android support libraries must use the exact same version

Today, I update my Android studio to 2.3, and I update gradle to 3.4.1. But when I build my project, an error occurred:
This is the error
So I add " buildToolsVersion '25.0.0' "
My project can build successful, but another error occurred. I can't solve it. I hope to get some help. Thank you!
This is the error
When I add compile 'com.prolificinteractive:material-calendarview:1.4.2', this error will occur.
This is my androidDependencies
This is probably an issue with Android Studio 2.3. There's a new inspection that checks if all dependencies of com.android.support use the same version number. However, multidex doesn't have a matching version number. You can disable the inspection via the red light bulb icon next to it as a work-around for now
it's an unnecessary warning for the support:multidex, add this:
//noinspection AndroidLintGradleCompatible
compile 'com.android.support:multidex:1.0.1'
I'm also using updated Studio. You should use each library with the same version in order to avoid the Manifest Merger issue. Like this.
// To Support Design, CardView and RecyclerView Library
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:palette-v7:25.2.0'
// To Support MultiDex
compile 'com.android.support:multidex:1.0.1'
Here you will notice that each library have the same version.
Change version of com.android.support:recyclerview-v7 and com.android.support:support-core-utils to 25.2.0 (last version of support library: https://developer.android.com/topic/libraries/support-library/revisions.html)

How I can resolve gradle sync issue on Android Studio 2.0?

enter image description here
I've installed it as it is directed in the pic, but it never seems to be resolved.
I'd be on cloud nine, if somebody could help me with this.
These are the correct version that you can add in your build.gradle according to the API needs.
API 22:
compile 'com.android.support:appcompat-v7:22.0.0'
API 23:
compile 'com.android.support:appcompat-v7:23.2.0'
According to your problem in your gradle file you must put below line,
compile 'com.android.support:appcompat-v7:23.2.0'
Click on blue link as and update your sdk...when you will update it, it again gives you error (to update gradle version) so again click on error link then finally Android Studio will work perfectly.

Failed to resolve: com.android.support:appcompat-v7:15.+

i find 2 solutions for this problem, but both didn't work. So i decided to ask you.
I'm using Debian 8 Jessie and Android Studio 1.4
I just created new project and when i tried to start it i got an error:
" Failed to resolve: com.android.support:appcompat-v7:15.+ "
And gives me 3 option.
1) Install Repository and sync project
When i tried it i got an error like this:
Loading SDK information...
Ignoring unknown package filter 'extra-android-m2repository'Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
And down of the window:
Install failed. Please check your network connection and try again. You may continue with creating your project, but it will not complete correctly without the missing components.
2) Show in File
It's my build.gradle dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:15.+'
}
Error in this line:
compile 'com.android.support:appcompat-v7:15.+'
3) Show in Project Structure dialog
Dependencies windows is opened and about this line again:
compile 'com.android.support:appcompat-v7:15.+'
Tried Solutions:
Firstly, i tried to download version sdk again. I deleted Android 4.0.3 and re-download again but still same error.
After that i tried to download support library which recommended in; topic 1 , topic 2. After i download Android Support Library, rev 23.0.1 still got same error.
After that i tried to solve my problem with fixing first option in error (install repository and sync project. And i found some topics again. I checked my HTTP Proxy section in Setting, already "No proxy" is selected.
So, i tried everything i found, but still i got this error. Someone can help me please?
After you downloaded the latest support library with your sdk manager, you can set that version in your gradle file.
If you downloaded 23.0.1 set it like this:
compile 'com.android.support:appcompat-v7:23.0.1'
EDIT:
Also note following hint, given by Android Studio, when using + in Version number:
Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds (com.android.support:appcompat-v7:23.1.+)
Using + in dependencies lets you automatically pick up the latest
available version rather than a specific, named version. However, this
is not recommended; your builds are not repeatable; you may have
tested with a slightly different version than what the build server
used. (Using a dynamic version as the major version number is more
problematic than using it in the minor version position.)
Edit build.gradle
Replace 'com.android.support:appcompat-v7:15.+' with 'com.android.support:appcompat-v7:18.0.0'
Sync It
May be this will help you. If in case this will not work i.e. show error then see for installation of app-compat in "%homepath%\AppData\Local\Android\sdk\extras\android\m2repository\com\android\support\appcompat-v7"
Search for the oldest version and put the version number at xx: 'com.android.support:appcompat-v7:xx'
I installed Java and Android Studio today.
When creating my first project with API level 15 as minSDK, I faced the same problem.
As far as I can tell, it seems the installation of the sdk works not pretty well. For me, API level 15 had only the SDK platform. API level 23 had platform and sources. I don't remember, which tools where installed.
To solve the problem, I started the sdk manager (old version), removed api level 15 completely and installed api level 23 as suggested. After that, a newly created project (again with minSDK 15) was properly created.
The difference in the app/build.gradle file is obvious.
Maybe this helps other people facing the same issues, or one of the gurus can further explain, what happened.
Kind Regards
Got same errors.
Mac OSX
V. 10.9.5
Android studio 1.4.1
App:
Before:
android {
compileSdkVersion 15
buildToolsVersion "19.1.0"
After:
android {
compileSdkVersion 23
buildToolsVersion "19.1.0"
Before:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:15.+'
}
After:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.o'
}
Above changes + Build >> Clean Project.
Hope that helps!
Go to Built tab select "Edit Built types" select properties tab and check built tool version it was 19.1.1 for me.
Then go to built.gradle change compile to 'com.android.support:appcompat-v7:19+' . I changed to 19+ because my built version is 19.1.1 ; You have to select according to your built version(18+,19+,20+ like that).
Try following solution:
In Android studio:
Go to File -> Project structure
Check the selected Build Tools Version.
update your build.gradle for app with selected build tools version.
for e.g. 19.1.0
After update, Run Clean.
Please refer below screenshot.[Project Structure-> Build Tools Types][1]
I had a similar error message when creating a project.
fail to resolve com.android.support:appcompat-v7:14.+
I notice that if I create a new project with support for 4.0.3 instead of 4.0, no error occurs. I am using android studio 1.5. Hope this helps.
in my case, support and wearable versions were different, after making them exactly same, gradle build completed successfully.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.0.0'
compile 'com.google.android.gms:play-services-wearable:11.0.4'
provided 'com.google.android.wearable:wearable:1.0.0'
}

Adding Google Play Services to gradle (Android Studio) does not work

I have the following problem:
I installed the Google Play Services library v27.0.0 to my SDK in Android Studio.
After that I added the compile dependencie to build.gradle (app folder):
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.google.android.gms:play-services:27.0.0'
}
But when I try to sync the project with Gradle, i get this error message:
Error:(25, 13) Failed to resolve: com.google.android.gms:play-services:27.0.0
I don't know what to do...
I don't think version 27.0.0 exists the most recent version is 8.1.0
There is one trick you can use with any dependency.
You know the name of dependency, lets consider com.google.android.gms:play-services:
Firstly, you need to use this expression
compile 'com.google.android.gms:play-services:+'
Note the plus sign. Than you click Sync Now to sync gradle. After that you will see that IDE suggests you not to use + sign.
But now you can use combination Alt+Enter and select Replace with specific version.
Now + sign will be replaced with the latest available version of this library.
Profit.

Categories

Resources