I'm a noob at Android programming, so I used Buildbox to make some kind of Android game...and when I was at the stage where I was supposed to import my game, 3 errors popped up in the problems section...I'm gonna just copy and paste them:
error: Error retrieving parent for item: No resource found that matches the given name '#android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar'
The container 'Android Dependencies' references non existing library 'C:\Users\Ivan\Desktop\BBDOC EXPORT\WallJump\android\libs\google-play-services_lib\bin\google-play-services_lib.jar'
And the obvious one:
The project cannot be built until build path errors are resolved
I'm gonna upload a screenshot too...
Click here to see for yourself
If you guys need any more details just tell me.
Related
This question already has answers here:
"cannot resolve symbol R" in Android Studio
(100 answers)
Closed 7 years ago.
I've been working on an app and all was going well, everything was working fine. Then I modified some code in my main activity, and when I tried to run the app, there was an apparent error in my code and the build failed.
After this, all the references to my layout files were no longer working (i.e., R.layout.) R was red and hover over says "Cannot resolve symbol R".
Searching you will find dozens of posts that propose many fixes, like: Clean Project; Rebuild Project; Sync Project with Gradle Files; Invalidate Cashes / Restart; Check xml for errors, restart Studio, etc... I've tried them all.
NONE OF WHICH WORK IN MY SITUATION.
My code is working and without errors because I can create a new Android Studio project, and add my classes and resources. The new Android Studio project will run the the SAME CODE under a different package name.
I encountered this same problem a while back and I vaguely remember deleting something from my project folder (might have been a folder or file). I don't remember what I deleted, but it did fix the problem.
Thanks for any advice.
I finally got Android Studio to build without errors, but honestly I don't know how this happened. It was very puzzling that I could have a project that worked and several copies that didn't (I must have re-created my project 10 times from scratch) each time I would copy the project to an archive directory and start over. One of my build requirements was I needed to compile on Jelly Bean, and I think Android Studio sets some sort of defaults when you open a new project with a Blank Activity. Anyway, each time the R. error occurred the build warning would display this:
<style name="Base.Widget.AppCompat.Spinner.Underlined" parent="android:Widget.Material.Spinner.Underlined
But my code does not contain a spinner, so I really can't figure out where this is coming from. In fact I've tried to replace files in one of my inoperable saved projects with the files from my working copy (manifests, code, gradle.build, etc.) yet once inoperable, it seems a Studio project will remain that way.
I wish I could reproduce the problem but I cannot.
WTF! After thinking I had resolved this the problem, it is back again. From my working project I did 2 things. Added a very simple activity, and added it's reference to the manifest. Tried to run the project and get the SAME error again, referencing the a spinner. The Gradle build message is:
C:\CargoBay\Android\LandApp\app\build\intermediates\res\merged\debug\values-ldltr-v21\values-ldltr-v21.xml
Error:(3) Error retrieving parent for item: No resource found that
matches the given name 'android:Widget.Material.Spinner.Underlined'.
I removed the new code from my project, and it still won't build.
I don't know what to think now.
In Android Studio select your project folder, go to VCS / Local History / Show History. Show History will list any files that were moved or deleted, and give you an option to restore the file.
If you select your main activity code, it shows the history of code changes, and you can restore to previous code that was working.
I've been busy with eclipse and stuck for a day with 2 last problems. Can please somebody help me?
error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
The container 'Android Dependencies' references non existing library 'C:\Users\XXX\workspace\android-support-v7-appcompat\bin\android-support-v7-appcompat.jar'
I know that the Bin folder does not contain the file. And the other problem has to do with the other one. But which library is he looking for and how do I get it loaded in there?
Does anybody know what to do? I've tried almost every solution, but no success so far.
I dont understand the part of where you have to choose which archive you have to choose to the built path? Do you
hope someone knows better.
Since hours I try to include the cardslib - https://github.com/gabrielemariotti/cardslib, unfortunately without success.
When I want to including as it's described in the https://github.com/gabrielemariotti/cardslib/blob/master/doc/BUILD.md#reference-this-project-as-a-library-in-eclipse.
When I want to load the lib into the workspace the Error "An internal error occurred during: "Adjusting Android Project Classpath".
Source attachment path 'C:\Users\User\android-sdks\sources\android-14' for IClasspathEntry must be absolute" appears.
I never had such an error before. What causes it?
After pressing "OK" the lib gets into the workspace and "cardslib] Using 1.7 requires compiling with Android 4.4 (KitKat); currently using API 14" is shown on the console. So the lib is marked with an error.
After getting through the document (mark as lib etc. in properties) I still get some errors:
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
BuildConfig.java /cardslib/gen/it/gmariotti/cardslib/library/cards line 1 Java Problem
error: Error retrieving parent for item: No resource found that matches the given name 'card.native'.
styles.xml /cardslib/res/values line 23 Android AAPT Problem
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project cardslib Unknown Java Problem
I asked google about it already but didn't find a match so I hope someone can help me out.
Thanks in advance.
I've recently deleted some other projects from my eclipse workspace (permamently) and after that in my current project appeared some errors (R cannot be resolved to a variable).
I tired cleaning and building again project, but this time it doesn't help.
In resources, errors appears only in styles.xml files:
error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
I'm new in android development and I don't understand what's exactly wrong. Probably something with theme, but I tried to change it to something different - without effects.
Download the v7-appcompat library, import it into Eclipse and reference it in those projects which are showing this error. This will solve your problem.
Basically, I need help importing downloaded source or creating a project from sample source programs. I'm looking for step by step instructions for both if anyone can point me there or post the steps.
I'm very new to Android/Eclipse. I have the environments installed and have successfully written a very minor app that works on the emulator and my real Droid X. I cannot, however, get any of the Android samples into a project without errors. I've tried importing, creating from existing source, and etcetera and it's all a mess with errors everywhere.
I have, however, successfully created a new empty project, then brought the components into the project one at a time typing or pasting in code for every file. I'd hover over and import Android and other components as needed. The WiktionarySimple, for example, ran with only a couple of changes and several warnings that I left alone. (I had to add 'formatted="false" in the statements below...)
<string name="template_user_agent" formatted="false">"%s/%s (Linux; Android)"</string>
<string name="template_wotd_title" formatted="false">"Wiktionary:Word of the day/%s %s"</string>
But there has to be an easier way to import! I've done the intuitive and I've followed instructions that I've found, but to no avail. Can anyone give me a complete list as to how to import or create a project from existing source or from source I've downloaded from the web?
Step #1: Start a new Android project
Step #2: In the first page of the Android project wizard, choose the "Create project from existing source" radio button, then click the Browse button and find the directory containing the project
Step #3: Tweak settings to suit, then press Finish
Step #4: If needed (not sure if it is anymore), right-click over the project name, and choose Build Path > Configure Build Path from the context menu, and make sure the Android entry in the checklist is checked
Its quite possible that you are not importing these projects incorrectly and that you are simply running into common problems that occur when importing projects.
For instance your problem involving adding formatted="false" is quite common and due to a change in the strictness of aapt, which is explained in this question. It is likely that the sample project was created before the change and has not been updated since.
That error involving the formatted="false" can also cause many more errors, since any xml after that error is often not parsed and thus any resources declared after it are not known. So the error No resource found that matches the given name (at 'hint' with value '#string/search_hint') and others like it are often due to the formatted="false" error. I would suggest fixing all the % sign errors with the formatted="false" then letting it rebuild and see how many errors are left.
As for the String types not allowed (at 'layout_width' with value 'match_parent') a quick search on stackoverflow says that its caused because FILL_PARENT was replaced with MATCH_PARENT in Android 2.2. So you need to set your sdk for the project to be Android 2.2 or higher. Here is the link to that question as well.
This happened to me in importing the wiktionary sample and i found the solution.
Import the project through existing code
Right click project and choose properties
In 'Android' Tab the default choice is the minimum API. Changed it to the latest(highest API)
Click ok.
Clean and build your project and errors will be gone
(probably optional)
6. Change the target and Minimum SDK in the Android Manifest