libgdx / gdx-video

A libGDX cross platform video rendering extension
Apache License 2.0
147 stars 48 forks source link

Issues with Android project? Build Path Issues? #17

Closed iMackshun closed 8 years ago

iMackshun commented 8 years ago

Sorry to bother you again. While the desktop project worked just fine, the Android project is giving me issues. As stated in the previous issue, I compiled the .jars in Mac OS X 10.10.2. I then switched over to Windows, and was able to get the desktop project working with jars created in Mac. However, whenever I tried adding "gdx-video-android.jar" to my Android project, it resulted in the error "Conversion to Dalvik format failed with error 1". I assumed that the problem could be due to the fact that they were compiled on a different operating system, so I recompiled "gdx-video-android" in Windows.(Although, there were some errors upon importing, Syntax errors, fixed by changing java compliance to 1.5, and issues like "The method isBuffered() of type VideoPlayerAndroid must override a superclass method") Eclipse recommends getting rid of the @Override annotations. Not sure why these errors were only present when I import it into Eclipse in Windows. I ignored these errors(didn't wan't to alter the classes) and compiled anyway. While adding the newly generated jar file doesn't result in the "conversion to dalvik" issue, it results in this error(http://pastebin.com/KKAnEwjs). Assuming this problem stems from the errors when importing in Windows, could you provide your compiled gdx-video-android.jar(that has worked in the past, of course)? Is this jar the only .jar that I need to add to the build path of the android project?

RBogie commented 8 years ago

Did you import the core library as well? The VideoPlayerCreator that it can't find, is a simple java method in the core project that uses reflection to find the platform specific videoplayer. Since it can't even find the method, it seems that the core library is not loaded.

iMackshun commented 8 years ago

Adding both "gdx-video.jar" and "gdx-video-android.jar" results in the following error. I probably should have mentioned that.

[2016-01-19 13:59:45 - VideoTest-android] Error generating final archive: Found duplicate file for APK: build.gradle Origin 1: C:\Users\Mack\Documents\VideoTest\android\libs\gdx-video.jar Origin 2: C:\Users\Mack\Documents\VideoTest\android\libs\gdx-video-android.jar

iMackshun commented 8 years ago

Not to press, but any leads? I've been trying to recompile these jars, but the process just isn't going smoothly as planned. I only have experience compiling jars within Eclipse. I've tried learning other ways, but I don't quite understand how Gradle works(or what is is for that matter), and no other IDE's make exporting .jars as easy as Eclipse does. If I could access precompiled jars the were confirmed working, it would save me the trouble of fumbling around, trying to export a working, no errors upon importing, fully-functioning .jar. Or, I can provide my .jars for testing to make sure it has nothing to do with my system or environment? Again, sorry for my lack of experience. This just seems like a pretty cool thing to be able to do for various reasons.

iMackshun commented 8 years ago

It seems that I am not allowed to add both files to the build path. But I have to, right? Even if I add one or the other, the java.lang.NoClassDefFoundError still persists, despite the gdx-video.jar clearly containing the "VideoPlayerCreator.class". I'll keep trying.

RBogie commented 8 years ago

Sorry for the response time. I'm quite busy at the moment. I'll try to look at it tonight.

RBogie commented 8 years ago

Ok, so I can't be sure what the issue is. I've never worked on android projects without using maven for building. The build.gradle is just a file having build info from the gradle build. Maven and gradle would normally filter out that file when including the library as a dependency. You can simply remove the file. Please try it with both jars on the classpath. Also remember that if you manually include a android specific library jar in eclipse, you have to also import it specifically as android library.

iMackshun commented 8 years ago

All fixed now. Works perfectly on Android. Instead of compiling the library as .jar files, I directly added the projects to the build paths of the Core and Android project. Now, it works perfectly! This is amaaazing! :D

RBogie commented 8 years ago

Good to hear everything works now :)