I'm trying to use BoofCV and I have the JAR in my /libs folder, with the rest of the JARs my app uses (and they work correctly) but it keeps giving me this error
04-26 15:53:12.110: E/AndroidRuntime(29683): java.lang.NoClassDefFoundError: boofcv.struct.geo.AssociatedPair
Even though I can go over to the jar file, navigate to that location and see AssociatedPair.class where it should be.
The jar is in my build path with the others so I don't understand why I'm getting this
As you already mentioned, this is a JDK 1.7 issue. Take a look at the comments section for this article on codeproject, it discusses this very issue:
http://www.codeproject.com/Articles/553637/Real-Time-Computer-Vision-on-Android-using-BoofCV
I have been able to get JDK 1.7 code to work in android using IntelliJ. The other option that worked for me was to recompile every library with JDK 1.6. There might also be a way to get eclipse to work using JDK 1.7 since there is a known fix, but as of a month or two ago it hadn't been incorporated into eclipse.
The latest version of BoofCV v0.14 should be compiled in JDK 1.6 and not JDK 1.7. If you have an older version try upgrading.
Related
I am trying to solve this problem for a few days now. Whenever I import ARCore SDK, to Unity, I cannot compile my project.
The error I am facing now is:
Minimum supported Gradle version is 5.6.4. Current Version is 5.1.1. If using the gradle wrapper, try editing the distributionUrl.
I did so, I saw in my eyes a new version is imported but I am keep getting this error.
Here are some other things I tried:
Trying to import the SDK to multiple versions of Unity.
Using a different computer.
Not changing the minimum API Level to 24.
Building the app without scenes.
trying to use different Gradle versions besides 5.6.4. In particular, 6.7, 6.1.1
Creating a system variable under Path: C:\Gradle\gradle-6.7\bin
Removing 5.1.1 folder from the Temp folder of the project, whenever I compile it (Although it keeps appearing of course)
Following the guide found at:
https://developers.google.com/ar/develop/unity/quickstart-android
Ensuring JDK, JVM and all required components are installed.
All to no avail. The project is not compiling.
Any help would be greatly appreciated!
EDIT:
I believe the root of the problem is that I haven't changed the Gradle version somewhere, despite doing so at the wrapper. The reason I stuck at 5.1.1 has something to do with the default Gradle version of my Unity version.
https://docs.unity3d.com/Manual/android-gradle-overview.html
Question is, how to solve it.
I can think about two ways to solve it (but they are pretty similar):
First Option:
Download the gradle version you want, navigate to where Unity's gradle is located in:
C:/{UnityEditorsDirectory}/{UnityVersionDirectory}/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/gradle
Then replace lib folder with your new gradle lib folder.
Second Option:
In case this doesn't work, you can also try to:
Open Unity Editor, go to the menu tab Edit->Preferences->External Tools
Scroll down and find this toggle:
If you uncheck the toggle, the editor will allow you to browse where your gradle is located, paste your new directory and try if it works.
TAKE CARE: Unity's gradle version is the one that Unity's people have tested so...something can explode unexpectedly!
I have Eclipse Luna installed on my Mac and yesterday night I downloaded from the sdk manager the latest android sdk (v. 21 Android 5.0). Unfortunately after the update I got several errors that I tried to solve following the instructions in several posts here in Stack Overflow.
1. In java build path under Android Dependencies the jar file for Appcompact 7 was not found under the bin folder. I've read that this was due to the fact that I should have set 21 as the project target for the support library then clear and build the library project so that the jar file would be automatically created under the bin folder, but that didn't happened.
2. I added the jar file of the library under the bin folder manually. At this point instead of having the exclamation mark on the project name I have all the files under src folder marked with errors as the R file is not recognized anymore. I don't have any errors in any xml file, but still R resources are not found in the project.
3. Every time I try to change the target sdk for my project to 21 or 21 with google apis I get an error stating "Parsing Data for Google Inc.:Google APIs:21 failed Unsupported major.minor version 51.0". I've read that probably this is due to the jdk version installed on the computer so I updated it to the version 8 and changed the compiler in Eclipse to the 1.8 version. That didn't solve the problem so I got it back to 1.6.
4. In the problems tab I have the following errors:
- The import com.google.android.gms cannot be resolved;
- R cannot be resolved to a variable;
- the method initializePoolObject() of type DBObjectStructure must override a superclass method.
Do you have any idea of how to get to work again wthout any problems?
The import com.google.android.gms cannot be resolved
com.google.android.gms comes from the Play Services SDK, which you attach to your application project as an Android library
project. Please check your environment to ensure that you have a
valid copy of the Play Services library project and that your
application project still points to it.
Install a new Play Services:
Follow the instruction from Google to install
'google-play-services-lib' project.
This is the documentation.
R cannot be resolved to a variable
Make sure that your compiling and target versions are set to
21. Its because the new AppCompat only compiles on 21.
Right click the project and click "Properties". Then select "Android" from the tree on the left. You can then select the target target version on the right.
Note: Make sure your properties, classpath and project files are writable otherwise it won't work
The method initializePoolObject() of type DBObjectStructure must override a superclass method.
You have to update your jdk version into 1.8 to overcome this
error.Also change the java compiling version of your project into 1.8
in eclipse.
When creating a new project for Lollipop, Android Studio warned that java 7 is required. I know java 8 is not yet supported in Android, so that won't work, but I suggest you go with the latest update of java 7, perhaps the issue in Eclipse is the same, just the warning is missing.
to fix the R not identified error migrate to android studio. Version .8 should be sufficient evidence that the beta version is of release quality.
For eclipse delete the import myapp.R and then re-add them this has worked for me in the past.
Try use other IDE like Andorid Studio or InteliJ IDE, maximum resolves your error.
I have basically just downloaded the newest android and eclipse bundle from Google, and upgraded the sdks to the newest versions. As well as installed the adt plugin.
Well... now all content of any library projects wont get recognized.
They are included fine as Libraries, but I get a red x whenever a class tries to reference anything from a library project. (Edit: the problem is that any library reference cannot be resolved.)
Nothing works. Cleaning, restructuring, restarting. The jars from the Library projects aren't being included in the bin folders anymore, and I can understand that that is from the new build system upgrade. But this also break everything!
Has anyone had a similar problem, and hopefully a solution?
(I am also running Windows 7 64 bit)
whatever library project you are using should have common support v4 jar file in lib folder,
so get the updated support v4 libary and replace all old v4 libary with that updated one.
still getting a error then post your logcat log
I've created a small JAR library in Netbeans containing a few non-platform specific classes and interfaces. I then use this JAR file in an Android Eclipse project by placing it in the libs folder. I can then import any class or interface into the android code with no problem. I can also extend the Android View class and implement an interface contained with the JAR file and this custom View is displayed in the Layout editor (in Eclipse) with no problem.
The problem comes when I attempt to run the app on the Emulator. It crashes and logcat gives a NoClassDefFoundError, complaining that it cannot resolve classes which are in the JAR file despite me including it in the build path.
I originally built the JAR file targeting JDK 1.7 but I happened to try changing it to JDK 1.6 and then the app works.
Has anyone else come across this? Is JDK 1.7 incompatible with Android?
javac -version reports 1.7.0_17
Android dosen't support JDK 1.7
Looks as though JDK 1.6 is required for compiling though the tools themselves (i.e. Eclipse) run OK on 1.7, as indicated here.
I'm using the Android SDK as a standalone version (since I don't like IDEs very much).
However, now I wanted to use the Support Libraries and downloaded them with the ./android tool. And I checked that the /extras/android/support/v4/android-support-v4.jar exists.
Yet, my compiler doesn't seem to recoginize them (error: package android.support does not exist).
I believe that I have to get them in my classpath somehow, but have no idea how this should work (on the android page it is only explained for IDEs).
Any suggestions?
While the Android Support library documentation focuses on the two main IDEs, the documentation on command-line projects has instructions on how to reference an Android library project.
I needed to specifically get the support libraries (a jar file) to be included in a legacy ant-based Android build, and I wasn't able to get the command line suggested by the links from CommonsWare to work (specifically, the suggestions from https://developer.android.com/tools/projects/projects-cmdline.html#ReferencingLibraryProject required that I actually have a full project to reference.)
As it turns out, all I had to do was put the support library jar (eg: android-support-v4.jar) in the project's lib directory and everything worked. That may be specific to the ant build I'm using, but I think it's the same build file that the google tools used to generate.