My laptop recently crashed, so I got an old desktop PC up and running. Got Eclipse installed along with Android SDK.
But when I check my Android project out of Subversion into Eclipse, I get errors that suggest it cannot find the ViewPagerIndicator library (which I did already add to my workspace/projects as a library).
When I go to my Android project's properties, on the Android tab at the bottom, and add the ViewPagerIndicator as a library it shows a green checkbox:
I click OK, and dialog dismisses. But then when I try building I get these errors:
E:\Workspace\foobar\res\values\styles.xml:4: error: Error: No resource found that matches the given name: attr 'vpiTabPageIndicatorStyle'.
E:\Workspace\foobar\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.TabPageIndicator'.
If I go back into my project's properties on the Android tab, the same ViewPagerIndicator library that had a green checkbox not 3 seconds prior now has a red X, and there's question mark beside it in the "Project" column:
Both my project and the ViewPagerIndicator project are set to compile with Java 1.6 and are both targeted at SDK v16.
Oh, and yeah the same Subversion revision was building just fine on my laptop so all the files are identical as they were before.
I don't feel right posting this as the answer to my own question because I'm still at a loss for what I was doing wrong, if anything.
But I ended up removing both my project and the ViewPageIndicator library project from my workspace, then re-adding them back. Everything worked. Go figure. Maybe this will help someone else.
Related
I'm using eclipse ADT (most recent version) to develop some android apps. I've followed the getting started tutorial at the dev.android.com and it worked just fine.
But when i tried to create another project with the same targets and sdk's, i've got nothing but errors:
Some errors and my sdk's:
That's the same sdk's i used before these errors started showing up.
What can be causing this?
EDIT: my project won't generate the R.java file
You might need to add a support library to your new project.
Check this link for downloading the support libraries -
http://developer.android.com/tools/support-library/setup.html#download
Please notice that you need to import them into your eclipse and then include one (preferably the newest, not sure about this) in your project.
EDIT:
Before downloading the support libraries you should first check if you have them already.
Try this, right click project folder in the eclipse package explorer, Properties>Android>Library>Add>select a library if you have one.
There might be an invalid library included in your project already, if that happens then you will see it in the Library>Add> menu, remove it and add a new one.
You might have clean your project ........
if yes.....you must check whether R.java file is present in **Project(your project)->gen->package name->R.java**
if not than u have to update Tool Folder in SDK manager
I installed (after unzipping) android-studio-ide-135.1224218-windows, hoping to be up and running a "hello world" program by now, but the IDE won't even start because "Your Android SDK is missing, out of date or missing templates." It tells me "You can configure your SDK via Configure | Project Defaults | Project Structure | SDKs" but when I do so, I see NOTHING in the text box for Android SDK location.
I searched for "android sdk" on my computer, and found C:\Program Files (x86)\Android\android-studio\plugins\android\lib\sdk-common.jar, but when I put that or C:\Program Files (x86)\Android\android-studio\plugins\android\lib into the text box, I get NO ERROR, but then I get the same message, and when I come back to the text box, IT DOESN'T HAVE WHAT I PUT INTO IT.
If I browse for the text box location, no matter what I put in, it says "Please choose a valid SDK directory".
That's the only "android sdk" on my computer.
I JUST installed Android Studio to C:\Program Files (x86)\Android\android-studio with no errors.
I have C:\Program Files\Java\jdk1.7.0_60 as JDK location. It won't let me change it to C:\Program Files (x86)\Java\jdk1.7.0_25.
I've Googled to see if I can download an android sdk from somewhere but found nothing.
WHAT DO I DO? I can't get into the IDE to try stuff.
sdk-common.jar is not the 'sdk' that Android Studio is looking for. You must download the sdk from SDK Manager and put it in the directory C:\Program Files (x86)\Android\android-studio\sdk.
This is what the sdk should contain:
sdk\build-tools
sdk\extras
sdk\platforms
sdk\platform-tools
...
I couldn't make use of the Answers above, so I uninstalled and then brute-force deleted EVERY trace of Android EVERYTHING.
Then I downloaded and installed installer_r23-windows.exe, putting the SDK manager out there BEFORE installing the Android Studio IDE. I allowed the default path: C:\Users\Dov\AppData\Local\Android\android-sdk.
Then I downloaded and installed android-studio-bundle-135.1245622-windows.exe--NOTE: BUNDLE, NOT IDE. I used the default folder: C:\Users\Dov\AppData\Local\Android\android-studio.
And I STILL got the SAME ERROR. But at least THIS time I could go into SDK Manager, as the error message said to do.
What I found was that the CORRECT path to the JDK, which was the same path shown in the SDK Manager dialog for installing packages. So why the error?
LOOOOOOONG story short... as I tried to browse for the path, I noticed that the AppData folder WAS NOT SHOWING.
SOLUTION: TYPE THE PATH BY HAND. It worked.
I CHANGED NOTHING, except my approach.
As it happens, "The [AppData] folder is hidden by default in File Explorer, and has three hidden sub-folders: Local, LocalLow, and Roaming." See here.
I assume that was Android Studio's problem, but why typing it by hand changed all that is anybody's guess.
I guess it's not a great idea to have AppData part of the DEFAULT install path.
(BTW, I did NOT have to mess with ANY environment variables.)
=== EDIT ===
I reinstalled Studio and SDK Manager and the above did not work. What I did BOTH times was to TRY to drag the SDK Manager.EXE file into the browse dialog from an Explorer window; it didn't work either time, but I tried today and THEN found success.... So I guess this seems to be a necessary step.... I also added \ after sdk in the text box for the SDK path.... And I clicked Apply before OK.... I hate when stuff works seemingly randomly.... Just trying to save others the frustration. Maybe Google needs to address this.
I had exactly this problem. After downloading Android Studio from the developer site:
android-studio-ide-135.1538390-windows.zip
But kept getting the error: "Your Android SDK is missing, out of date or missing templates."
Wasted several hours, but eventually went to the "Installing the Stand-alone SDK Tools" page:
https://developer.android.com/sdk/installing/index.html?pkg=tools
And downloaded and installed installer_r23.0.2-windows.exe.
Then I added its location to Configure -> Project Defaults -> Project Structure
I can now create projects.
So I'm trying to import an existing project to eclipse and it's causing me a lot of trouble. I'll explain step by step, exactly how I'm trying to import it and someone please help me finish the importing because no matter how I do it, I still keep getting errors.
So as soon as I finish importing the existing android application there is a red exclamation mark (!) next to the project folder in eclipse. So I right clicked it and selected 'configure build path'
I then click on every single jar and select a new path. First, I found android support v4 in sdk/extras/android/support/v4, then I found google-play-services_lib in sdk/extras/google/google_play_services/libproject/google-play-services_lib/bin, and the last one (google-play-services) is at google-play-services_lib/bin.
So now after I'm done setting paths for those jars, the red exclamation mark disappears and a new error appears.
Now I right clicked the project again and selected properties --> android and this is what I see:
I then imported google-play-services_lib in eclipse as 'library project', but the red cross remained there, so I tried adding it manually with 'add button'.
As for the other 2 missing libraries, I googled about it and found out that CaptureActivity is from zxing barcode scanned library. So I downloaded the newest zxing version (2.2) and imported the library manually, same as I did with google play services. Right after importing CaptureActivity in eclipse and before even adding it to my application, this is what happens and I have no idea how to fix it.
Even though the eclipse gave me an error when importing zxing 2.2, I still added it to my project's libraries and now some errors disappeared. The only error I'm still getting is on qr_portrait_camera in folder layout:
So I right clicked my imported project again to see build paths again and this is what I notice:
So this is it. This is where I'm stuck and can't go forward, I googled a lot, did every kind of research I could and I don't know what to do anymore.
These are the three remaining problems that I've got:
I need to import one more library and I don't know where to find it (PortraitQR):
CaptureActiviy imported library project still shows a lot of red errors and I don't know how to fix that.
There's a CaptureActivity.jar in build path that shows an error and I can't either remove it or find a path to it.
I really need to fix this as soon as possible, I will be very grateful for any kind of help!
I figured it out. I just had to put all jars in libs folder and then download all 3 libraries, The one missing was causing all the trouble.
I'm building an Android app.
I worked today on my app, and suddenly I saw that all the projects in the workspace are marked with an error. I don't know what caused it, and I can't find explanation of the error anywhere.
I'm using Helios with Windows 7. I even tried downloading Eclipse again but it didn't help.
Today I tried to integrate Facebook with my app. Their tutorial required me to try to get a hesh key from a keystore. In the process I added an Environment Variable named JAVA_HOME, and pointed it to the JDK.
I don't know if it's the cause of my problem, but I think it might be related.
I really don't know what to do.
Thanks!
Try this. In eclipse, go to Project --> Clean --> Select "clean all projects". This should rebuild all projects.
Try cleaning your android project. I get problems with Eclipse sometime, and if I clean the project, it fixes it.
Find the "Problems" view. That will give you more details. Post the description of the problems, we can get more information.
click Window -> Show View -> Problems
Typically, the problem is with a resource you've recently added to your project (drawable, assets, raw, etc.)
Some things to check are:
Invalid XML files
Invalid 9-patch images (outer 1-pixel border must be full black or transparent)
Typically, just start by removing a resource, then cleaning your project (Project > Clean). If the errors go away, that resource is your problem. If not, continue this process until the error DOES go away. Start with the most recent resources you've added, naturally.
i solved error or all project showing errors this way.... close eclipse.
then Right Click on eclipse shortcut-->open file location-->open command widows there and type "eclipse.exe -clean" eclipse the starts..and in my case errors were gone...hope it helps
I'm using Eclipse to learn to develop Android applications in Java. I haven't used Eclipse before.
The project I'm trying to use (supplied by OReilly as part of 'Android Application Development') is MJAndroid. When attempting to run the project, the Run fails, and the Problems tab mentions com.java.Object can't be found, and Eclipse asks me to check the build path. Clicking
Properties -> Java Build Path -> Libraries, the message 'Unable to get system library for the project' is displayed.
On a working project, Properties -> Java Build Path -> Libraries has an entry for Android 1.1, which if I click Edit, has the classpath container path of com.android.ide.eclipse.adt.ANDROID_FRAMEWORK.
It seems a simple matter of adding the correct container path to my non-working project. However Eclipse seems determined to make this as difficult as possible. No matter what I chose to add - jars, externals jars, variables, libraries, class folders, external class folders, nothing seems to take the form of 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK' that the 'Android 1.1' entry on the working app has.
How can I add this namespace to my project so it resembles the working one?
I'm quite sure it's a problem with Eclipse's somewhat odd user interface. Frankly there' nothing I'd prefer more than a file to modify and set such information - my background is in Python, and the whole eclipse environment seems an unnecessary burden.
I had faced the same issue when I imported a sample code downloaded from the internet. I am using android sdk 1.5 with 0.9 ADT plugins. Here is a simpler way to fix the andoid library reference issues
Right click on the project which has
issues and select properties
Select the appropriate Android build
(1.1, 1.5 or 1.5 with google api) and
say ok
Again right click on the project and
select "Android Tools > Fix Project
Properties"
Fix the imports once (if required)
Refresh the project and you should be
ready to go without any manual
editing
I faced this same problem after importing a project through GIT. The problem was that I didn't have the same target android platform installed, and the build path somehow got corrupted.
The first obvious thing i did was changing the target sdk in the project.properties, but even after cleaning up the project and Android Tools > Fix Project Properties, it didn't help and I was still getting the build error.
My solution after wasting close to 1 hour trying to figure this out?
RESTART ECLIPSE
Everything worked fine after that. Eclipse is pretty fickle. Only through years of experience you'll then understand her well. :)
Had the same problem and it turns out the Android SDK Location was not set which was a really simple fix. Go to Window->Preferences, click on 'Android' on the left hand menu, fill in the location of the Android SDK (e.g. C:\Program Files\Android\android-sdk) and click OK. Everything worked fine for me after that.
Found the answer in this set up guide: http://developer.motorola.com/docstools/library/Installing-Android-Dev-Environment/
Sometimes Eclipse can get a bit funny (technical term) with classpath container resolution.
You have a working project in your workspace, so you can rule out plugin installation issues. You could try opening the .classpath file (hidden by default, select the triangle in the top-right of the Package Explorer view, select Filters... and uncheck .* resources) and manually adding the container declaration.
`<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>`
You may then have to close the project and open it again (right-click->Close Project) before Eclipse recognises the change.
You may also find that there is an Android builder and/or nature. If you compare the .project files for the working and non-working versions you may see entries for Android builders/natures. Copying the relevant entries may resolve the issue.
sometimes, eclipse can help you.
In Android projects, click right button on the project-> Android Tools -> Fix Project Properties.
It's usefull in class path errors!!
Luck!
I would verify you have the correct version of Java installed as well as the Android SDK. I would recommend installing/reinstalling the ADT plugin in your eclipse, makes it alot easier to create the android project.
http://developer.android.com/sdk/1.5_r2/installing.html
Also. I guess the path of the Android SDK must be setup correctly. This happened when I was overloaded with projects and I decided to create a new workspace copying some existing stuff into it.
Seems that the new workspace requires you to setup these details too once again
Is that setup properly?