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.
Related
I have tried to use Xamarin Android Facebook Component to native login to Facebook. but I get these two errorrs:
No resource identifier found for attribute 'cardElevation' in package 'com.facebook.samples.audiencenetwork'
No resource identifier found for attribute 'cardBackgroundColor' in package 'com.facebook.samples.audiencenetwork'
Would you please tell me how to solve it?
I found the problem.
1- do not install the SDK as a component
2- Add these DLLs: Xamarin .Support .v4
Xamarin .Support.v7 .CardView
Xamarin .Support .v7 .AppCompat
Xamarin .Facebook
And it will work
Hi i am trying to use a Vector drawable to draw a fingerprint icon from the example xml from android dev website and i get an errior saying it cant find any of the attributes set on this drawable.
below is the code:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40.0dp"
android:height="40.0dp"
android:viewportWidth="40.0"
android:viewportHeight="40.0">
<path
android:pathData="M20.0,20.0m-20.0,0.0a20.0,20.0 0.0,1.0 1.0,40.0 0.0a20.0,20.0 0.0,1.0 1.0,-40.0 0.0"
android:fillColor="#009688"/>
<path
android:pathData="M11.2,21.41l1.63,-1.619999 4.17,4.169998 10.59,-10.589999 1.619999,1.63 -12.209999,12.209999z"
android:fillColor="#FFFFFF"/>
</vector>
My Min and compiledSdk is set to 19 :
errors i get when i try to do a clean/rebuild:
Error:(17) No resource identifier found for attribute 'viewportWidth' in package 'android'
Error:(17) No resource identifier found for attribute 'viewportHeight' in package 'android'
Error:(22) No resource identifier found for attribute 'pathData' in package 'android'
Error:(22) No resource identifier found for attribute 'fillColor' in package 'android'
Error:(25) No resource identifier found for attribute 'pathData' in package 'android'
Error:(25) No resource identifier found for attribute 'fillColor' in package 'android'
Vector drawables are available in API level 21, you cant use them in API 19
http://developer.android.com/training/material/drawables.html
As mentioned by others this is because VectorDrawables are available in API 21 and up, but you're working with API 19.
At present there is no official support for VectorDrawables for API levels before 21(well, sort of, see the final paragraph).
Here's the current situation as far as I know it. There are a couple of third party libraries available for using vectors in earlier APIs:
Mr Vector - they state that this is now no longer maintained, they are awaiting an official version for the Support library
vector-compat - they don't actually say this is no longer going to be maintained, but the last update is 7 months ago
However, there is a slightly different type of support in Android Studio for earlier APIs. This approach instead of using actual VectorDrawables in the earlier versions will instead generate PNG files to replace the Vector ones when you build your project. For this to work, make sure your Gradle Plugin is up to date(1.5.0 or above). You may also need to need increase your compile sdk version to 21 or above.
Download aapt.exe
and keep the file in the same directory in which you apktool.jar and apktool.bat files are.
Use commands java -jar apktool.jar d -s your_apk_file.apk for decompiling and java -jar apktool.jar b folder_name for compiling. Here folder_name is the name of the folder that generated after decompiling.
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">
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.
I searched a lot of time for a fix, but don't find an answer.
Since I've updated the Android SDK to R14 (Android 4.0), I get the Error "Error: No resource found that matches the given name (at 'background with value '#layout/card_top').
The Part in my xml-file is this:
<LinearLayout
android:id="#+id/card_top_bkg"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="#layout/card_top"
android:layout_weight="2">
The "card_top.xml" file is in an separate library-folder and not in the same filder as the base project. If i put the card_top.xml file directly under layout/card_top.xml in the base project folder, it works.
Knows anyone how to get it working with leaving the xml-file in the library-folder?
Maybe the problem is solved in r15, it's just a bug fix release:
http://developer.android.com/sdk/tools-notes.html#
http://developer.android.com/sdk/eclipse-adt.html#