I have downloaded OpenCV-2.4.8-android-sdk and android-ndk-r9c. I followed a tutorial by Stanford university, which tells me to import all sample projects from the OpenCV SDK directory and then everything will work magically.
Obviously, that is not the case. Below is a screenshot of one of the sample projects (and its build path) that I imported to Eclipse:
Do you know of a valid and recent tutorial to make the OpenCV samples running?
I checked the tutorial on OpenCV website but it does not describe how to get the samples running. In particular, I am confused about these:
2) I can see that I am missing all android.* and org.opencv.android.* imports. Do I need to manually include these to the build paths of the projects?
3) Where does the Android NDK go in this process?
4) There is no ./jni/Andorid.mk file in any of the projects. Do I have to manually add these?
Right click each sample project folder > Properties > Select Android from the left list of options:
1) Check if you have something for "Project Build target" (example: "Android 4.4.2").
2) Check if you have something in the "library" box and if it does not have a red X next to its path. If it has a red X, edit to select the correct path to where you placed the opencv library.
Also do step (1) for the Opencv Library project, if you imported it to your workspace like it is described in the installation tutorial.
The steps explained in the Android Development with OpenCV article helped me solve the problem:
Do take caution in using outdated tutorials on the web. In my case, the Stanford university tutorial was outdated and was therefore misleading.
Look for documents dated 2012-2013 when you are dealing with OpenCV.
You should follow these steps:
Right click on the example marked with errors ->
Select android from the list ->
on Project Build Target hit the checkbox ->
then apply.
After that the error for the specific example should be gone.
Try project->clean->clean all.
Related
For the last 2 days I've been trying to simply get Google play game services Integrated into my game. I've followed the instructions here...
https://github.com/playgameservices/android-basic-samples/blob/master/README.md
...many many times. I have been trying to get it to build with Gradle but for now, I'll just focus on Eclipse building until that works. I've imported BaseGameUtils project into my workspace as an Android library project. My game android project has two Android library dependencies: google-play-services_lib and BaseGameUtils. Everything in Eclipse is showing without any errors. When I build and run on a real device, I see an error that says -
[2014-10-27 20:39:25 - BaseGameUtils] Could not find BaseGameUtils.apk!
I don't know why it's even looking for BaseGameUtils.apk since it should be an Android library. That said, I'm not sure how an Android library is really handled so maybe it should be a .apk. In any case, I couldn't find any information on this bug and the error message doesn't give me much to work with. I've tried adjusting things in the Build Path but no luck. I did have to remove some redundant dependencies in my Build Path earlier since I was getting some kind of duplicate DEX error but I'm not sure that's related in any way to this. I am desperate for help, anyone have any idea?
Can you try this? It has to do with conflicting methods of specifying that a project is a library.
I found the source of the problem!
It turns out that "with the new library feature, you don't specify the
Android projects you depend on in the Java Build Path section of the
Properties. You do it in the Android section of the Properties".
So all I had to do is go the Application Project's Properties, hit the
Projects tab, select my own library project and click the Remove
button. That's it. No more problem.
In Eclipse Java EE select the project Properties, then select Project
References, then check the FacebookSDK (see screen capture)
From: Android Eclipse - Could not find *.apk
If that doesn't help, you may want to double check that you selected "Is Library" in BaseGameUtils.
Also, when you hit "Run" in Eclipse, are you running your application and not BaseGameUtils?
Please would you check that BaseGameUtils has "is library" checked and that your application project DOES NOT have "is library" checked.
If this is correct, then please would you review the following in detail (especially as regards checking and unchecking "is library" ) :
Android Eclipse - Could not find *.apk
I presume that the DEX error related to two or more versions of the same lib. What is the specific GameHelper error ?
As a general point, I find it productive to get a sample project working first to ensure that I have got the environment working correctly before I start integrating game services into my own projects. If you have been changing the build path then it may be quicker to start from scratch and get a sample working. I have followed those instructions in the past and they are accurate.
I would like to compile the sample provided by Sony for his SmartWatch. I followed the instructions in this page. But when I added the the SmartExtensionUtils project I saw lot of errors like: com.sonyericsson.extras.liveware.aef cannot be resolved to a variable. Instead this import com.sonyericsson.extras.liveware has no problem.
Did someone find and solve this issue?
In order for the EightPuzzleGame to compile, you need to add the following library projects that are available in the SDK:
SmartExtensionAPI
SmartExtensionUtils
SmartExtensionInternalUtils
In your case, it is the API project that is probably missing. You can see what library projects that are missing by checking the project properties. Example:
What you need to do is go to the properties page of the SmartExtensionUtils library and in the library box add SmartExtensionAPI as a dependency
This is a link to my desktop screenshot. SmartExtensionAPI and utils are in the project list (left side) but the EightPuzzleExtension does not find them
You don't need SmartExtensionInternalUtils project. When you create project from existing source, check Import project into Workspace. In this way EightPuzzle, SEAPI and SEUtils will be in the same directory and you'll not have no errors :)
I had this problem too. What i did is to solve it, is to import from the Sony samples in the Sony add-on SDK 3.0 the SmartExtensionAPI first and than SmartExtensionUtils. If these samples are build correctly the other samples will build correctly as well.
Go to File|Import, choose SmartExtensionAPI as your root directory and click finish. Maybe you have to change the compiler compliance level to build it correctly. After this do the same for SmartExtensionUtils.
Ok, i've wasted an hour trying to figure it out, even though it's something really simple.
I've downloaded some code from github. I'd like to use this in my android application. How do I go about adding it? It's not a jar file, and i tried drag dropping it and linking the files, and it didn't work. Importing and refreshing / cleaning the project didn't work.
I'm not sure where I'm going wrong. Any help is greatly appreciated!
If this is a project you want to import in eclipse, right click on eclipse left pane (the project list), import, android project from files, select the repository folder.
If this is a library you want to use in you app, there is another step : go to the properties of your project, android tab and in the library section click on add, then select the library project.
By design, android code that contains layout resources (for example ActionBar Sherlock) can not be embedded in a jar. So you have to use it as a library project. It is very convenient though, since it allows you to look at or modify the library code very quickly.
You may also need to let Eclipse know that your library project is a library and not an app. To do so, in the same Properties/Android screen you just have to check the "is a library" checkbox.
Reference on that topic : official documentation
In Eclipse:
File->New->Other->"Android Project from exiting Code"
If I change some code, save, and Run, it runs the last version of the program, not what I just saved. The only way I can make it update is if I Clean the project, Build the project, and then Run the project. Is there some way to avoid this tedium?
I spent some time create two dummy projects (one Android and one Java) and have a play with it, and finally come up with a workaround which is not used very often but able to solve your requirements.
First, I will explain your question a bit more (based on my understanding and what I have tried) so that other people can have a more clear understand about what is happened here.
According to the conversation in comments:
could you tell me what you have in following setting: project->properties->Builder ? – Sudar Nimalan
#SudarNimalan: I am not sure this is what you are asking, but: there's text that says "Configure the builders for this project", and under it is a single option, "Java builder", which is selected (checked). – shino
for android project, there should be, "Android Resource Manager", "Android Pre Compiler", "Java Builder", "Android Package Builder" in this order, chould you add those and try? – Sudar Nimalan
#SudarNimalan: I owe you an apology; I do have those four components. My "project" is split into 4 projects - "core", "core-android", "core-desktop", and "core-html". It's a little weird because I set it up with the libGDX project setup UI, and I was looking at the 'core' project when I answered your question. My 'core-android' project has all four (in that order), and it is the one that has the problem in my question. – shino
Scenario:
You have 4 project:
core: a regular java project (common pure java code here)
core-android: an Android application project.
core-desktop: not related to question so ignored.
core-html: not related to question so ignored.
The core-android project has dependency on core project, by adding core to core-android's build path (Properties -> Java Build Path -> Projects -> Add ...) and export list (Properties -> Java Build Path -> Order and Export).
Problem (Not Really):
Change some code in core and save it, run core-android, eclipse install last compiled apk, not the new one with change.
Reason:
The is the expected behavior, the way you used to reference core project in core-android only create a weak link (or something sort of) between core and core-android, the core-andorid's auto-build script doesn't aware any changes made in core. You have to clean the project (only need clean core-android project) so that Eclipse can delete the existing apk (under bin directory) and re-generate the apk (with the latest code changes from core).
See Xav's comments below, Android SDK tools should aware changes from plain Java project under project build path, and it does not behaviour this feature normally at the moment.
Note that if core is an Android Library project, then there is no problem and your core-android project will aware any changes in core project (java code, android resource and etc), if core is only used in core-android, this could also be a workaround: turn Java project core into Android library project.
Workaround (Eclipse Link Source):
There is another way (not commonly used) for adding soft link between projects:
First, you need remove core project from core-android's build path, this will also remove it from Export and Order list.
Right click core-android, choose Build Path -> Link Source ... Add ../core/src as Linked Folder Location and src-lib1 as Folder Name,see screen screen in the end.
This create a symbolic link src-lib1 under core-android in Package Explorer windows point to core's src foder, in the file system, you still have two separate project folder. Now if you change some code in core and run core-android, Eclipse will build and install latest apk. No need to clean core-android project.
Link Source Window:
Final look in Package Explorer:
You should always consider the normal approach as first option, after all, manual clean project is not a big deal compare to the unusual approach I described above.
Please follow this steps..
1. Project--> Build Automatically been checked??
2. Please following setting: project->properties->Builder like that?
Check below image.
And Also Check Below Settings.
Also Check Below Image
IF problem continues then please Update your ADT & SDK.
Hope it works for you .
Navigate to Windows->Preferences->Android->Build. Make sure that the checkbox "Skip packaging and dexing..." is NOT checked.
The Problem is the In your Eclipse, go to Project Properties - Builder, There is one CheckBox with AndroidPackageBuilder that is required to be Checked True. Now everytime you will do any changes in you project that will be reflected in your build and the Compiler will never say that
"Application Already Deployed, No need to Reinstall"
This will work evenif you dont have selected Build Automatically, Because everytime you run by clicking Run icon or Ctrl+F11 that will first Build the Project and Then Run it. So The requirement is just to Enable the Android Package Builder
You won't believe how easy and silly is the solution
On Eclipse,
go to Window-Prefences->run/debug ->launching
And then, on Save required dirty editors before launching :
choose the Prompt option,
Apply and OK
Does anyone know where you can get the droid fu jar from? I have no idea how to install it from github
Read the Droid-Fu documentation, specifically the "How do I install it?" section, which explains, step by step, precisely how to build a JAR for your use.
If you do not understand those instructions, please contact the developer, or simply do not use the library.
Also, please do not ask duplicate questions.
Is this library? Can you download it? If you can download it, Right click on the project -> Build Path -> Configure Build Path -> Select the Libraries Tab -> Add external JAR -> Browse you jar and add it. Now import the library.
Not sure why its at java2s but http://www.java2s.com/Code/Jar/d/Downloaddroidfu10jar.htm appears to be the correct jar. I've used it just to see if it works and it does.
For some general explanation regarding Droid-Fu: see this post
Also, look at ignition now, as Droid-Fu is discontinued.