I want to use the QuiltView lib in my Android project.
When I try the demo, I've no problems, but when I want to use it in my project I've got this error :
error: No resource identifier found for attribute 'scrollOrientation' in package 'com.jake.quiltview'
I've just include libs (QuiltViewLib & GridLayoutV7) in my project...
So, have you got an idea ?
You have to fix the namespace. The XML he used references his own project. You have to change it to reference yours. I had this issue too.
Change
xmlns:app="http://schemas.android.com/apk/res/com.jake.quiltviewsample
To:
xmlns:app="http://schemas.android.com/apk/lib/com.package.class
Obviously changing it to match your project package. :)
Related
I am using actionbarsherlock library in my android app and I am using one of its style attribute with the name of popupPromptView but when I try to generate the apk for my app, it gives me this error:
C:\Users\My Username\.gradle\caches\transforms-2\files-2.1\fa481916e694bf5a6973eb98ad535c2d\jetified-actionbarsherlock-4.4.0\res\values\values.xml:268:5-296:25: AAPT: error: resource android:attr/popupPromptView is private.
I tried going to this values.xml file and comment out this style attribute but when I try to generate the apk again, that line which I commented comes back again. I don't know what's wrong. I have even tried deleting the cache folder of .gradle but still no luck.
I had the same problem
You can solve downloading Sherlock as a module itself to compile together with your project (I imported the Sherlock modules from a Eclipse project) instead of using a library reference
In this way you can remove that line in a definitive way
it made my day
https://developer.android.com/studio/command-line/aapt2
In previous versions of AAPT, the compiler would silently ignore foregroundInsidePadding attributes when you define it with the android namespace. When using AAPT2, the compiler catches this early and throws the following build error:
Error: (...) resource android:attr/foregroundInsidePadding is private
To resolve this issue, simply replace android:foregroundInsidePadding with foregroundInsidePadding.
I'm using two 3rd party libs, both use the same attribute name in their attrs.xml. The build fails with:
Attribute "tabBackground" has already been defined
Is there a way to work around this collision without modifying the argument name in one of the libs?
Actually no.
I suppose you have a dependency from A project to B.
When you build your main project in Eclipse, the resources will fail to build and an error is printed out in the Android console: "... error: Attribute "icon" has already been defined".
Actually you have two ways :
remove dependency from A project to B
OR change attribute name of some project
Also if you build project with Gradle you can use this article which explains how to merge resources.
I'm using Xamarin to build an android application but I'm having this error every time I try to compile the application.
I've added my attrs.xml file to Resources/values, referenced my namespace like this:
xmlns:custom="http://schemas.android.com/apk/res/mynamespace" and added the property to the view.
What am I missing? I've seen several examples but all seem to be working ok.
The reference is all in lower letters to avoid errors. I've also tried removing the http://... part and changing the folder "res" for "lib". These changes make the app to compile but I'm unable then to get the value of the parameter.
Please, any help will be really appreciated.
Best regards.
I've found the answer to my problem. It seems that it's not necessary to keep the lower letters when referencing the package name so if your package name is "MyNamespace", instead of using:
xmlns:custom="http://schemas.android.com/apk/res/mynamespace
you have to use:
xmlns:custom="http://schemas.android.com/apk/res/MyNamespace
It works now!
I'm using android-support-v7-appcompat as a library in my Android project. Now I want to include actionbarsherlock as another library project. When I add the second library, it gives so many errors like below
android-support-v7-appcompat\res\values\attrs.xml:476: error: Attribute "attributeName" has already been defined
By changing one attribute value and it's related code snippet is a one solution that I've tried. But when there are nearly 80 lines like above, it will get a messy. Is there any other way I can solve this issue?
The correct way to solve this problem is by updating Android Support Libraries in all relevant projects and library projects. In my case I've used Android support library and also one of the library project to implement my application. When I update both libraries, the problem solved. The way of updating Android support library is;
Right click on the project
Select Android Tools from the pop up window
Select Add Support Library
Remove the appcompact support library project from Properties = > Android
Gradle Resource Merger merges all resource folders from all dependencies and place into single folder. In case there are duplicates build process will fail.
Fortunately, if you look below under Output: label, you will find the right path to the problem.
Here is an example
in your case it is
android-support-v7-appcompat\res\values\attrs.xml:476: error: Attribute "attributeName" has already been defined
You can also build your project from command line and get the right path.
attributeName
Inside values\attrs.xml file on line 476 you would find a with property named "attributeName". Most probably it is your own styleable that you have to change to get rid of the duplicate.
So now, when you know the reason, you can locate that property in your project module and replace it with different name.
I solved this by removing appcompact from project, and changing in styles to
<style name="AppBaseTheme" parent="Theme.Sherlock">
I updated the build tools version and resynced, it worked fine.
I copy appcompat folder from Android SDK extras v7 folder and create a Android library module in my project. Compiling project I get errors, first one being appcompat/res/layout/abc_action_mode_close_item.xml:17: error: Error: No resource found that matches the given name (at 'contentDescription' with value '#string/abc_action_mode_done'). Looks like appcompat needs mediarouter resources as well. So I create a Android library module mediarouter. I set mediarouter as a dependency for appcompat library. Compile. Now I get the error mediarouter/res/values/styles.xml:18: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionButton'. I add depenency appcompat to mediarouter. Compile. Now I get the errors
appcompat/res/values/attrs.xml:32: error: Attribute "windowActionBar" has already been defined
Help!
You just need to add "#string/abc_action_mode_done" in your appcompat/res/values/strings.Do not "set mediarouter as a dependency for appcompat library".(In my case,"#string/abc_action_mode_done" already exists in the appcompat/res/values/strings.I don't know why you miss it.)
"add depenency appcompat to mediarouter" is necessary.
I stumbled across this problem and it seems to be a bug in IDEA:
when you create the library module, IDEA will create some boilerplate files in the new module. During this operation, IDEA will overwrite the strings.xml resource file with some kind of template strings.xml-file intended for newly created android applications (IDEA will also create other stuff you don't want or need).
There are two workarounds:
1. Create the library module in IDEA first and copy the appcompat-resources afterwards into the existing library module directory
2. Just make the sub folders readonly before you create the library module in IDEA. This will prevent IDEA from changing the files in the library.
After that, the library module compiled on my machine.