I have an Android project, consisting of multiple modules. I do not use Gradle.
With Android 2.2.3 the project worked well, but I updated my Android Studio to 2.3.
When I loaded the main project, I got this message:
Update Property Files
The structure of following Android modules was changed:
ActionbarSherlock
I checked my repository to see what has changed in the main project, and in in my project config, I found the following.
These line were removed:
# This file is automatically generated by IntelliJ IDEA
# Project target.
target=android-16
android.library.reference.1=../ActionbarSherlock
android.library.reference.2=../WizarDroid
And this line is added:
# This file is automatically generated by IntelliJ IDEA
# Project target.
target=android-16
project.type=0
In the module dependencies, I still can see the module, yet I get compile errors:
D:\MainProject\res\values\styles.xml:51: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light'.
D:\MainProject\res\values\styles.xml:53: error: Error: No resource found that matches the given name: attr 'actionBarTabStyle'.
What can I do about that?
UPDATE:
I could not make it work with 2.3, so I reverted back to 2.2.3.
Now, when my project is compiled and run, it crashes with the following errors:
java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.Button
On the message dialog, it shows a completely different text instead of the OK text. It really messed up my project...
I had to revert back to 2.2.3 and add the modules again.
I guess, in 2.3 only Gradle is safe...
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.
Everything starts out fine with setting up the workspace and project, but I can'at run as an application because there are errors I can't clear. I have tried building java paths and downloading sdk tools and libraries.
and then these errors occur... I did try to connect to appcompat v7 jar, but it did not work. I am a beginner to Eclipse it would be nice if anyone can give some detailed answers and solutions please.
The errors are specifically:
error: Error retrieving parent for item: No resource found that matches the given
name 'android:Widget.Material.ActionButton'. styles_base.xml /appcompat_v7/res/values-v21
The container 'Android Dependencies' references non existing library 'C:\Users\Documents\Android Experiments\appcompat_v7\bin\appcompat_v7.jar'
The project cannot be built until build path errors are resolved
You may want to search for similar posts here at oDesk, ie: Hello World Android App, Error: workspace\appcompat_v7\res\values-v21\styles_base.xml No resource found that matches the given name
AFAIK the first issue happens when you install Android-L SDK, it somehow conflicts with Eclipse's new project wizard (the wizard adds those resource files with errors, you can just remove them in res folder)
About the second issue - probably you need to fix path to appcompat_v7.jar file, see the post where it is in project settings. It may fix the first issue as well, I'm not sure
It's time to switch to android studio even though it's beta the build is .8 which should suffice as significant evidence that it's nearing release. The gradle builds with appcompat are seamless automatic it's so much easier than eclipse to use external libraries.
This is all it takes in the build.gradle with android studio.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21+'
compile "com.android.support:support-v4:21+"
}
First of all i want to say that i know this topics have been brought up lots of times. But i can't seem to find the solution for this problem.
This is some of the errors from the log:
/home/name/adt-bundle-linux-x86_64-20140702/sdk/extras/android/support/v7/appcompat/res/values-v14/themes_base.xml:159: error: Error: No resource found that matches the given name: attr 'android:actionBarWidgetTheme'.
/home/name/workspace/Projectname/res/values-v14/styles.xml:4: error: Error: No resource found that matches the given name: attr 'android:actionBarStyle'.
/home/name/workspace/Projectname/res/values-v14/styles.xml:5: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
/home/name/workspace/Projectname/res/values-v14/styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name '#android:style/Widget.Holo.ActionBar'.
I'v made a custom theme, and im using Actionbar.
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="9" />
All of this used to work, then i had to reinstall my eclipse, so i imported the project to the freshly installed one. And that is when the errors occurred.
The R.File is also missing.
Please help me, im starting to lose my mind becuase of this problem.
EDIT 1:
To clear things out. I added the android-support-v7-appcompat with this method (Adding libraries with resources):
http://developer.android.com/tools/support-library/setup.html
The project build target on android-support-v7-appcompat is Android 4.0 and the project build target on my project is Android 2.3.3.
Is this right? Im not really sure what it should be like.
I can't say exactly, but if you are using appcompt library,
Project(Right Click)--> Properties--> Android--> Library section--> Add--> appcompt library.
can you please check this once.
Edit :
Compile with API Level 14 - when you compile your app with SDK level 9, the compiler doesn't know the elements shown in the error log
Or Project(Right Click)--> Android Tools --> Add Support Library / Fix Project Property..
I am attempting to merge a pre-existing Android project that uses appcompat with a game written using LibGDX. The problem is, I have no clue how to tell Gradle I need appcompat.
I've tried adding appcompat via the usual method (see the section labeled "Adding libraries with resources") and while this works for a regular project, it fails for the LibGDX's Gradle one. Where there is usually a check-mark verifying that a library project was added successfully, this just has a red x.
Screenshots of Properties Pages:
Example Errors due to this problem:
Error retrieving parent for item: No resource found that matches the given name '#style/Theme.AppCompat'.
So my question is, how do I build a LibGDX project with appcompat using Eclipse?
Have you tried adding the dependency into the build.gradle file?
dependencies {
...
compile "com.android.support:appcompat-v7:18.0.+"
}
I just updated to the latest Android SDK Tools, r12.
Now compiling of my current project fails by
UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException:
already added: Lorg/anddev/andengine/audio/BaseAudioEntity;
<= The library is definitely added only once - so this must be a compiling problem.
It also fails finding some standard android themes:
...\res\values\styles.xml:4: error: Error retrieving parent for item:
No resource found that matches the given name
'#android:style/TextAppearance.Holo.Inverse'.
The paths to the SDK and other included libraries are correct.
Anyone with same issues?
Thank you!
OK I got the compiling issue fixed - this happened because I included an external library (AndEngine) which sources already were existent in the /out folder. After clearing the folder's contents the project compiled correctly.
"UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added: Lorg/anddev/andengine/audio/BaseAudioEntity;"
Most probably there are AndEngine and some extension jars build so, that extension include classes of andengine. To resolve this issue -> exclude andengine src during rebuilding extensions (uncheck folder in export window).