Couldn't resolve resource #style/Widget.Holo.Light.ActionMode.Inverse - android

I'm creating an Android app in Android Studio. When I open the layout editor, I see that gray "popup window" on top of the layout, which says that it
Couldn't resolve resource #style/Widget.Holo.Light.ActionMode.Inverse.
This happens when I change the "rendering version" to API 15 (Android 4.0.3).
It worked a minute ago, but when I switched back to the layout, I just got this error.
Edit: I use the AppCompat library.
The theme is defined like this
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar" />
The app works fine when I run it, but doesn't render correctly (at least it's giving me the error) in the editor.
I would be glad if someone could help me with this. Thanks!

This problem occured to me when updating Android Studio to version 1.1.0 and opening an old project without changing anything.
For me only changing the preview's rendering API to 19 or above makes the message disappear.

Hey I faced the same problem and the solution that i figured out was - In android studio Open the Select Theme Dialog and under the All category select NoTitleBar.OverlayActionModes and press okay.
The problem would be solved. But it can show up into a dark theme.

Make you project API Level newer.
For me,the problem occured when my build.gradle content like this:
compileSdkVersion 16
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.xiaoguang.xx"
minSdkVersion 16
targetSdkVersion 16
versionCode 1
versionName "1.0"
}
After i download the sdk 19 and change build.gradle, the problem was fixed.
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.xiaoguang.xx"
minSdkVersion 19
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
change preview'api

Related

problem in my first project of android studio

When I was creating a new project it showed this warning and I do not understand what is it for.
This is the image of the warning it is showing.image
I changed to 31 and here are some screenshots regarding the issue.
Try changing the compileSdk to 31 instead of 32 in your build.gradle.
change your compileSdkVersion and targetSdkVersion in build.gradel file
compileSdkVersion 31
targetSdkVersion 31

parsing error when install apk in android 11

when I install my apk in devices with android 11, I get parsing error, but in another devices with lower android version, I have not this problem. how I can solve it?
my apk is very simple, it is just a web view with fcm packages and have not any special permission in manifest file.
Open your build.gradle file and you will see something like this
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.yourapp"
minSdkVersion 19
targetSdkVersion 30
versionCode 11
Now you have to change the targetSdkVersion to 30 or above (only if possible).
Recompile and Install, I should work by now.
Still if it didn't work, include the error log in your question.

Android application compatibility with old APIs

I created an app with the API 22 and I want to know if is necessary create a new project to make it compatible with the previous versions (for example with the API 19) or if I can do something simpler and efficient
If you're using gradle just set the minSdkVersion to the number you'd like to use:
defaultConfig {
applicationId "com.example.mypackage"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
in the app's build.gradle file
There are 2 way,
1) Set your "minSdkVersion" from gradle file
or
2) In Android Studio,
File --> Project Structure --> app (on left menu) --> Flavors
then set "Min Sdk Version"

Apps are not supported in lesser than v5.0(lollipop)

In android studio, i have create new project that run on 2.2(that shows 100% compatibility). The project is about calculation. I have installed on my phone(lollipop), and the app is working properly. But, I tried to install in my friends kitkat phone, the app is installed but, When i open the app, that shows Unfortunately the app has stopped. So, I need a help. What I have to do?
Thank You.
May be you set Minimum SDK at Lollipop check it out in build.gradle file.
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.communitynow.communitynow"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
and add
compile 'com.android.support:multidex:1.0.0'
in gradle file
Here in defaultConig{} minSdkVersion should be 15 or according to your minimum android run requirement.
You need to create a kit kat emulator to run the app on then check the log cat to see what the error is.

Android build version and minSDKVersion in Android Studio

I have read other answers in context of "What is minSDKVersion and targetSDKVersion?" on SO and those were good enough for understanding but they talked about eclipse, not that it really matters that much.
Anyway, I wanted to ask in context of Android Studio, that when creating new app, it asks for minSDKVersion only but no targetSDKVersion as it used to do in Eclipse. Why is this? Is it insignificant?
The other thing I wanted to ask is, when I did create a new app infact with minSDKVersion as IceCreamSandwich(4.0.3), the class MyActivity extended from ActionBarActivity and not from Activity. Why is this happening?
Are minSDKVersion and targetSDKVersion equal in this case? and if this is the case, Would I get the base class as Activityif I were to change the targetSDKVersion explicitly to say, API 21?
In Android Studio, everything turns around Gradle.
Your build.gradle file has this in it:
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId 'your.package.name'
minSdkVersion 14
targetSdkVersion 22 // default is latest
versionCode 1
versionName '1.0.0'
}
}
Here you can see the minSdkVersion and targetSdkVersion.
Nothing is required in the AndroidManifest.xml file anymore, regarding API levels.
Regarding your Activity issue:
ActionBarActivity is a child class of Activity.
ActionBarActivity is given automatically provided as it's the newest support tool available w.r.t. the minSDKVersion. If you simply want to use Activity, just change it in the code and remove unused methods.

Categories

Resources