Error in changing the android API level? - android

when i am creating new project i added API level 14 , i have completed my application and i want to change the API level to 10 ,
i am getting and error in resources-->values-v11--> style.xml
i.e error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'.
in resources-->values-v14--> style.xml
i.e error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'.
i dint understood this can any one explain

Following ankita gahoi's advice, I searched a little further and solved the problem.
Try this:
Delete the folders 'values-11' and 'values-14' (if any of them exist). Then, if this error shows up in the console window:
"No resource identifier found for attribute 'showAsAction' in package 'android'"
Read the answers to these questions:
"No resource identifier found for attribute 'showAsAction' in package 'android'" (Jason Hanley's)
How to change target build on Android project? (Alan Will's)
My build target was already set to the right Android version, so I set it to 'Google APIs' and then back to the former target.

These themes are available in API level 11 or higher so it will not work.because you are using API level 10.
refer this link-
http://developer.android.com/guide/topics/ui/themes.html

Happened to me on a specific case where one of the Android Library Projects had its reference SDK set to API 9. What got me confused was that the Error Log showed the name of the project with the correct settings, and not the problematic one.

go to values-v11--> style.xml. replace code :
<style name="LightThemeSelector" parent="android:Theme.Light">
by code :
<style name="LightThemeSelector" parent="android:Theme.Light">

Related

No resource found that matches color/holo_blue_dark

I am getting this error on my android application in eclipse.
Error Msg:
Error: No resource found that matches the given name (at 'drawable' with value "#android:color/holo_blue_dark")
What does it mean and how to fix it ?
This mean that resource is not available.
#android:color/holo_blue_dark
This resource is available from the api level 11 and above, to resolve that make sure your minimum sdk level in manifest is 11+ also api level for android is also 11+

Android application error in eclipse

Whenever i run the code as an application in my Eclipse it shows an error:
\workspace\appcompat_v7\res\values-v21\themes_base.xml:150: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
But the example files runs. How to rectify it?
Make sure your appcompat_v7 targeting Android 5.0 or later.
First check your minApi:
Notice that android:windowElevation works for API > 20
If your API is right:
make sure you have installed Android 5.0 SDK via the SDK-Manager
For pre-lollipop devices check this
change this line in your style.xml file
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
to :
<style name="AppBaseTheme" parent="android:Theme.Light">

Faced with Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'

I am stuck with a problem, I have created a basic hello world app following official website! now when I try running the app I see error as
error:
Error retrieving parent for item: No resource found that matches the given name '
Theme.AppCompat.Light.DarkActionBar'.
Resourse: styles.xml
path: /Test_1/res/values-v14
Location : line 8
Type: Android AAPT Problem
I tried adding v7 library by [Project ->Properties->Android] and click on "Add" but I do not see any thing in the resulted project Selection pop up. I see error in (appcompat-v7 ->res->values-large-v14->themes_base.xml
code:
<style name="Theme.Base.AppCompat.DialogWhenLarge"
parent="Theme.Base.AppCompat.DialogWhenLarge.Base" />
<style name="Theme.Base.AppCompat.Light.DialogWhenLarge"
parent="Theme.Base.AppCompat.Light.DialogWhenLarge.Base" />
My target sdk is API 19 and min sdk version is 7, I am not sure how to deal with this. could you please help.
It looks like all Theme.Base.xxxx was renamed to Base.Theme.xxxx
Try to use Base.Theme.AppCompat.DialogWhenLarge

Android ActionBar Compatibility

I was going through this sample package which Google has provided with it's sdk. I tried changing the api level to 7 and observed that there were many unresolved errors in the project.
I'm listing a few here:
ICE_CREAM_SANDWICH cannot be resolved or is not a field (ActionBarActivity.java)
R cannot be resolved to a variable (This is probably due to the fact my xml also contains errors)
SHOW_AS_ACTION_IF_ROOM cannot be resolved or is not a field (ActionBarHelperBase.java)
The method setActionView(View) is undefined for the type MenuItem (ActionBarHelperHoneycomb.java)
The method getActionBar() is undefined for the type Activity (ActionBarHelperICS.java)
The import android.view.ActionProvider cannot be resolved (SimpleMenuItem.java)
in res/values-v13/styles.xml - error: Error retrieving parent for item: No resource found that matches the given name 'android:style/
TextAppearance.Holo.Widget.ActionBar.Title'.
error: Error: No resource found that matches the given name: attr 'android:actionBarStyle'. (in res/values-v11/styles.xml)
Any idea how to get rid of these errors? Basically I'm targeting android devices 2.x and later. Does using actionbarsherlock is another alternative? I read here on some post that action bar compatibility package works on 2.x android devices as well.
Right click on your project in the Package Manager, then highlight the Android node in the Properties dialog that opens. You will see a list of Project Build Targets. Select the API level 14, Android 4.0 build target. This will get rid of the error.
Unfortunately, that also means it won't show up on your emulated devices that are using Android 2.3.3. You'll have to create a new one in the AVD that supports 4.0.
You shouldn't change the api version. The manifest declares min-sdk-version as 4, which means it will work on 2.x devices. Try loading it on the emulator, using api version 14 to compile.

android resource not found

I put this in my LinearLayout
style="?android:attr/buttonBarStyle"
but i got an error like this
No resource found that matches the
given name (at 'style' with value
'?android:attr/buttonBarStyle').
How to solve this??
which version you are using? as style="?android:attr/buttonBarStyle" is available in Android v3.0
check this for reference: http://developer.android.com/reference/android/R.attr.html
Try using style="#android:style/ButtonBar". This style is available in older version of Android, but android:attr/buttonBarStyle is available only in Android 3.0, like Zoombie has already said.

Categories

Resources