Problems importing the android support library with resources - android

As soon as I finish importing the android support library project into my workspace (I am using eclipse ide), I receive this error message:
Could not not write to file: C:\Program Files\extras\android\support\v7\appcompat\bin
The library project appears in my workspace, however if i try a clean build:
Errors occurred during the build. Errors running builder 'Android
Package Builder' on project 'android-support-v7-appcompat'. Resource
'/android-support-v7-appcompat/bin' does not exist.
Here is the stack trace:
[2013-12-17 18:11:20 - android-support-v7-appcompat] Android requires
compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use
Android Tools > Fix Project Properties.
The error log also states that bin folder does not exist/cannot be written to.
Here are things I have tried so far and failed:
1. Clean build
2. Install then re install
3. Fix android properties.
I have not used any of the API from the support library.

Open the project properties in Eclipse. Choose Java Compiler and make sure the Compiler Compliance level is set to 1.5 or 1.6.

Related

Android, Eclipse in Mac

Hi I am trying to make an android app on my Mac but am getting the following error when creating a new project
[2015-03-09 18:33:06 - appcompat_v7] WARNING: unable to write jarlist cache file /Users/shareennainar/Documents/workspace/appcompat_v7/bin/jarlist.cache
any help will be appreciated
Try this :
Project->Properties->Java build path. On the "Order and Export" tab, make sure you have checked all the libraries the project is referring to in your case appcompat_v7
Be sure you have android:minSdkVersion="14", else change it to 14 and do Project -> Clean
Also you can take a look -> this or this
If you don't need specifically use eclipse I encourage you to use Android Studio. I changed from eclipse to Android Studio and I think it's one of the best choices I did in my work.
P.S: That error looks like you don't have the appcompat library installed in your project. Are you using gradle? if so try to add it using the following line.
compile 'com.android.support:appcompat-v7:21.0.+'
If you don't use gradle you must add it manually.
EDIT: Here you can see how to import different libraries into your android project.
http://android-er.blogspot.com.es/2013/12/create-library-project-with-appcompat.html
This error means you're trying to load a Java "class" file that was compiled with a newer version of Java than you have installed.
For example, your .class file could have been compiled for JDK 7, and you're trying to run it with JDK 6. To solve this, you may take one of these solutions:
In Eclipse's menu
Window -> Preferences -> Java -> Compiler
Check "Configure Project Specific Settings".
Upgrade your Java runtime or
Recompile the class if you have the source, using your local Java compiler (if you have one).
javac FileName.java

Issues in Manual OpenCV4Android SDK setup

After the import step on this page: http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html#import-opencv-library-and-samples-to-the-eclipse
I keep getting the following errors like in a popup in Eclipse:
Building workspace: Errors occurred during the build. Errors running
builder 'Android Resource Manager' on project 'OpenCV Library -
#OPENCV_VERSION#'. java.lang.NullPointerException Errors running
builder 'Android Resource Manager' on project 'OpenCV Sample - 15
puzzle'. java.lang.NullPointerException Errors running builder
'Android Resource Manager' on project 'OpenCV Sample -
camera-calibration'. java.lang.NullPointerException
Cleaning all projects: Errors occurred during the build. Errors
running builder 'Android Package Builder' on project 'OpenCV Library -
#OPENCV_VERSION#'. Resource '/OpenCV Library - #OPENCV_VERSION#/bin'
does not exist. Resource '/OpenCV Library - #OPENCV_VERSION#/bin' does
not exist. I followed the warning and note given at the bottom as
well, but that did help.
My OpenCV4Android SDK version is 2.4.9.
I ran into the same problem -- I didn't wind up needing to switch to OpenCV4Android 2.4.8, but deleting my 2.4.9 directory and re-unzipping it and going through the steps from scratch seemed to fix everything. I'm sure I just corrupted some files, and re-extracting my SDK fixed it.
So long story short:
Make sure you follow EVERY step in the tutorial:
http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html
Make SURE that when you import the sample projects that you do it from the ROOT of the SDK directory -- not from the sample directory -- otherwise you miss the library.
Make SURE that you don't extract your OpenCV directory into a directory with spaces in the path (such as "My Documents").
And if you're wrestling it with a while and you can't seem to get it working, then don't hesitate to quit eclipse, delete your workspace, delete your OpenCV directory, and re-extract from the downloaded zip file and try again.
I had the same frustrating problem, I had to do two steps (different again!):
Open Properties for the Open CV library project (mine was OpenCV Library - 2.4.10), go to Android -> Project Build Target, and select a target name. (This is mentioned in the tutorial.)
Still in the Properties dialog, go to Java Build Path -> Source, at the bottom where it says Default output folder: mine said "OpenCV Library - 2.4.10/cls" - I changed this to "OpenCV Library - 2.4.10/bin"
And now it's building without errors.
I did both of the following together:
Set NDKROOT for all projects individually even though the environment variable existed in my bashrc.
Switched to OpenCV4Android SDK version 2.4.8

How to fix my Android Project in Eclipse?

I've downloaded my project from the server in another PC, and imported it in Eclipse, but now it does note run.
I've already cleaned the project at Project menu, and fix the projet properties in Android Tools.
I am getting these errors:
Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
The Fix Project Properties does not works.
I think the problem is the relative path. I've got an error like res' does not exist.
Where I set this relative path in my project?
How about to change 'compiler compliance level'?
You can find that - Project property > java compiler
1.6 or 1.7 may fix your problem...

Adding android library project to an android project prevents Ant from building

I'm adding an android library project to my android app (in this case, Beintoo). It's not mine; It's an external library. However, it doesn't come with a build.xml. Building in Eclipse works fine, but when I attempt to build my app with ant, I get this:
BUILD FAILED
C:\Sandbox\MyProject\build.xml:110: The following error occurred while executing this line:
C:\Sandbox\MyProject\build.xml:41: The following error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:515: Invalid file: C:\Git\Beintoo-Android\beintoo-android-sdk\BeintooSDK\build.xml
It's perfectly true. The file is invalid, because it doesn't exist. I wouldn't know what to do to add it safely, nor if that's even a good idea.
I have learnt that I can't simply build the library project into a jar. How can I get my project to build in Ant with this library project?
Ok, so, Error 454's answer was close, but not quite right. Since r14 of Android Tools, every library project must have it's own build.xml if it is to be built by Ant, as noted here:
https://groups.google.com/forum/?fromgroups#!topic/adt-dev/Z2e3dY-3Ma0
Running android update lib-project (which, as Error 454 notes, is in the android-sdk/tools folder which should be in PATH) on the library project will add a generic build.xml, and allow the main project to build.
For library projects, you need to browse to the library project root and run:
android update lib-project -p .
The android executable is in the android sdk/tools folder which should be added to your path variable in your OS. Once you run this, the necessary build files will be generated and your ant build should succeed.
Similarly, if your root project doesn't have the necessary build files, you will need to browse to the main project root and run:
android update project -p .
Additionally to the two previous correct answers I had to add --target android-16 because I was getting an "Error: The project either has no target set or the target is invalid."
So in my case
android update lib-project -p . --target android-16
Did it. (replace the 16 as you need)

copying or renaming an android project in eclipse

Iv'e tried to copy and paste a project in the same workspace. The project gets copied but doesn't run on my device.
If I leave the default name e.g "copy of myProject" it works.
If I try to rename using the refractor option the project shows an error:
"Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.."
when I fix the project as suggested It fails load to my device
Go to project properties file and change the project name and clean and build the project.It should work then

Categories

Resources