I am getting trouble with my eclipse.
I'm not yet starting to code. just started making a android app project and errors
are showing already.
problem tab
DZOGRAFI : i've tried what you answered , this is the result. T_T
[edit]
By having a look at the problem tab and the project explorer window I am guessing there is something wrong with the appcompat_v7 library. It cannot be built for some reason.
So, first of all make sure that you actually want to use the v7 support library (Eclipse automatically imports the library when you start a new project using some features). I can see inside your MainActivity.java file that you are extending MainActivity from ActionBarActivity (which automatically imports android.support.v7.app.ActionBarActivity into your project). Extend from Activity instead if you don't actually need the ActionBarActivity class.
If you actually need the support library, keep one copy of it into your workspace (Delete the others) and check if it is updated to the latest version. Inside Eclipse go to Window->Android SDK Manager and scroll down to the extras folder. Check for newer versions of the Android Support Library.
Additionally make sure you have downloaded the SDK platform for the latest APIs and the latest android SDK-Build Tools.
[edit]
Try removing the project (Right click ->Delete) and importing it again. Go to
File->Import then select Android->Existing Android Code into Workspace and click Next. In the window that appears click Browse and go to your Android SDK Folder and look for [Android SDK Folder]\extras\android\support\v7\appcompat. The project should be checked for import and then click "Finish". Clean the appcompat project and then the one you are working on. Please make sure that you are building the appcompat project using the latest API Level (Inside the appcompat Properties->Android check the Android 6.0 Build Target)
Also make sure that in your project's properties you have set the appcompat project as a Library for your project.
After you have done those. Clean and Build the entire workspace and restart Eclipse.
Hope this solves your problems
Related
I didn't know what appcompat_v7 was meant for til now. Unknowingly, I deleted it not just from the Package Explorer but also its physical file folder, now, my apps won't work because of this. I tried looking for it by Importing from the Library and even installed the Android Support Library from SDK Manager, and I still can't find it. How do I fix this?
If you are using android studio, follow these steps
1. Remove it from build.gradle dependency list( compile 'com.android.support:appcompat-v7:+') and restart android studio.
2. Now add the appcompat library back again, and click on sync at top right of build.gradle. It will download and install again.
I imported the Facebook SDK as library project into eclipse. I did it by checking Copy projects into Workspace and by leaving it unchecked as well (for some reason the description says that I must uncheck it).
I tried importing Existing Projects into Workspace and Existing Android Code Into Workspace as well.
The library checkbox is checked in the properties.
A Facebook sdk has never been imported into this workspace yet.
I created a new project that runs smoothly without Facebook. In the properties, Android tab, I added the library project. It showed a green tick, but when I open that tab again, it shows a red x.
The target of the project is API level 19, the target of the facebook library is API level 8. I also tried it with API level 10
I am using Java compiler 1.6 in both the project and the library.
What I don't understand is that the sample projects that came with the SDK seem to have successfully imported the SDK (green tick), however they all point to the same problem "The import android.support cannot be resolved" on import android.support.v4.app.FragmentActivity; I had to hover over the line and click Fix Project setup to make them work. Then I went to Properties -> Java Build Path -> Order and Export -> clicked v4 support library checkbox. So at least they work. Why do they successfully load the Facebook SDK and why is my app unable to do it?
The Facebook SDK has no libs folder so I guess an interference between different v4 support libraries is out of the question.
I have tried this on two different computers as well.
I decided to install Android from step to step instead of the ADT Bundle. I downloaded Eclipse Juno for Java Developers, installed the newest Java version (1.8) and installed the Android packages. Created a new project and imported the facebook sdk 3.5 (tried 3.0.2 and 3.8 as well). I still get the red X.
I appreciate any help.
I ran into this issue half a year later and my earlier answer was of no help. The trick is that you need to have the library on the same drive as your project, which is usually the C: drive. That's all. Thank you Facebook for not notifying us about this..
Solved. Here is what I did to solve this strange error.
Copy the contents of project.properties file.
Delete project.properties file.
Create a new file and name it project.properties
Paste the contents of the previous file into this new file.
I was working on an android tutorial and it wanted me to import the library from another project .The import worked and the project works correctly. But I noticed that doing that messed up several of my other projects (the ones that use Android 2.1) by apparently messing with the build path. Now instead of seeing "Google APIs [Android 2.1]" under the gen folder I see "Unable to get system library for project".
I verified the following:
I right-clicked the project and went to Properties I see that the correct Project Build Target is checked(Google APIs [Android 2.1]), but "Unable to get system library for project" is still shown above the assets folder and below gen and Android Dependencies. Cleaning all projects doesn't help.
How can I fix this problem?
is there a way to fix this issue globally or do I have to do it one by one?
I had the same problem. Try
Right click on your project
Go to properties
Click the Android section
Select a different target api (assuming one is already selected, as mine was - otherwise, select the one you want and jump to step 9)
Click OK
Do steps 1-3 again
Select your original target api
Click OK
Clean and build your project
Worked for me, anyway.
Derived the solution from:
"Unable to get system library for project" after I upgraded to Android SDK 2.3 and ADT 8.0
Error in .classpath on your project. It not connect to android sdk. Fix it and clean project. :-)
This happens when you are targetting an API version that for some reason is not mapped on your buildpath.
See which is the version of the SDK you are pointing to at the project.properties file.
Go to the SDK Manager at Window->Android SDK Manager
Check the Android API item that matches the version you want to use, OR, click on the latest one and then update your project.properties file.
Make sure your project build configuration is Project->"Build Automatically"
Retsart Eclipse (claning and rebuilding may not refresh all the project properties)
Borrowing from #Erhannis answer :
"
Right click on your project
Go to properties
Click the Android section
"
When I view the build target everything looked fine :
So I checked another build target , hit apply, and then re checked my original build target (Android 4.4.2) and re-hit apply. My project then compiled.
For me the project.properties file was missing (it was code from a repo I checked out). So I just created one with this line:
target=android-20
After that, Erhannis' solution worked for me.
Just for completing Erhannis answer: If you fixed the problem but it appears again when you restart Eclipse, then just go to the file local.properties on your workspace folder and verify that the location of the Android SDK there is correct.
At times, when only single Android SDK version is installed on your system, and if it gets changed either by un-installing / re-installing Eclipse, or otherwise (directly through SDK Manager), then this issue might crop up.
.
This is accompanied by the message like this on Eclipse console:
YourApp] Unable to resolve target 'android-22'
.
A simple workaround to this issue is:
Open AndroidManifests.xml of the project, and in the:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />
change the targetSdkVersion to the one currently installed on your system
Next, open the project.properties file and update
target=android-21
to your current SDK version
Finally, clean and re-build the project
Right Click on Project-> Select Android tools -> Select Fix Project Properties
This did the trick for me.
You need to click on the menu icon with the Android sitting in the grey box with a white arrow pointing down "Opens the Android SDK Manager".
or, from the command line, run:
%ANDROID_HOME%\tools\android sdk
I was working on an android tutorial and it wanted me to import the library from another project. All well and good. The import worked and the project works correctly. But I noticed that doing that messed up several of my other projects (the ones that use Android 2.2) by apparently messing with the build path. Now instead of seeing "Google APIs [Android 2.2]" under the gen folder I see "Unable to get system library for project". When I right-click the project and go to Properties I see that the correct Project Build Target is checked(Google APIs [Android 2.2]), but "Unable to get system library for project" is still shown above the assets folder and below gen and Android Dependencies. Cleaning all projects doesn't help. How can I fix this problem, and is there a way to fix this issue globally or do I have to do it one by one?
In the project root folder you should have file named project.properties
---- file content -----
target=android-16 ## <--- make sure that it is there and that you have proper sdk installed
For me, the problem was that in the Project settings - Android tab, I had no Android version selected.
For me I had SDK version 8 selcted, but if I selected the next highest version, applied, then selected version 8 again and apply, fixed the problem.
For me, what worked was to restart Eclipse. Hope this helps.
Whenever i am trying to run my project, i am getting this error in the console.
"Could not find **.apk"
Operating system: windows XP
IDE: Eclipse SDK
Version: 3.4.2
Build id: M20090211-1700
Android: 1.6
ADT: ADT 10.0.0
FYI: it is only happening with a single project, other projects are running fine..
I think this can happen when you rename the library project out from underneath the dependent project. Eclipse is reasonably good about about updating dependencies in most cases but this one seems fragile.
First try removing and then re-adding your library in Project > Properties > Android > Library.
If that doesn't work try cleaning your projects, exiting Eclipse, and opening the ".classpath" file in your project's root directory. If you see a line that references your library project under a previous name, just delete it, save the file, and relaunch Eclipse. Build the library project and then your dependent one. You may need to re-add the library like I mentioned above. This is what worked for me at least.
Edit note: I also found some stale references in my .project files. They didn't seem to be causing any problems but I removed them too. If you do that, be sure to search for the old name in that file as there was a whole "link" section near the bottom that also referenced it.
Make sure after updating your android sdk sdk build tools are updated properly.
You can check it by Open sdk manager -"Android Sdk Build Tools" status must be installed.
if the status is not installed then install Android Sdk Build Tools for the same.
restart your eclipse and try again
check this it might be helpful to you
Make sure your project imported the Android 1.6 library correctly. That is, under your project, you should see 'Android 1.6', which expands and displays 'android.jar'.
If it says Referenced Libraries > android.jar, you will need to fix this by manually altering the .classpath for the project.
Open .classpath for the project and type the following:
The important line is the 3rd classpathentry, which is the actual link to the Android SDK libraries.
source
clean your project and check . eclipse is not building apk file.
check this thread. It might help you.
http://groups.google.com/group/android-developers/browse_thread/thread/2c3e45540b915945/f06e10bcda3ad68b?lnk=raot&pli=1
Run eclipse as administrator and then import your project
Update Android SDK, is what did it for me.
I was building a game with the LibGdx Framework and got the same error. I tried several solutions from various posts at stackoverflow and others.
Found help in a post at the LibGdx Forum:
http://www.badlogicgames.com/wordpress/?p=3010 Posted by Mario, on May 18, 2013
Just updated to ADT 22, so should you. However, the process wasn’t all that smooth. What you need to do:
Update the ADT plugin in Eclipse (Help -> Check for Updates)
Open the Android SDK Manager, either from within Eclipse, or from
your Android SDK folder
Fetch all the updates
Fetch all the updates again
Fetch the updates one more time…
The end result should be an updated ADT plugin, as well as up to date SDK packages. Make sure you have all three of the ones in the following image, with the exact version numbers.
I needed to update them only once and from there on it worked.
Even if this post is outdated I figured I'll share this, because I lost a day finding nothing.
I experienced that problem, too, when I created an android project that was using an android library. Obviously I didn't know how to incorporate a library into an application the right way. I wrongly used project dependencies (Java Build Path/projects) or adding a library (Java Build Path/Libraries). While all I had to do was go to the Android tab and import my android library by means of the add button from the Library section.
I am using PhoneGap and I checked several solutions about configuration (properties, build path). However, my problem was that I tried to run everything with the default setup for Eclipse. Then, I solved it going to the SDK manager to install: Android SDK Build-tools, and it worked.
Mine was caused by this problem (incompatibility between ADT and SDK), and was fixed thus:
Eclipse > Help
Install New Software
Add 'https://dl-ssl.google.com/android/eclipse/' to 'Work With'
section and press enter
After developer tools appears on the list, check it and click Next
Restart eclipse once download is finished
Make sure put correct SDK Location (I have 2 instances of SDK and update wrong once).