I want to convert a wav file into flac on Android platform using Unity3d Game Engine. So I downloaded the latest version of javaFlacEncoder and converted the .jar file into .dll using ikvmc.exe so I can use its functionality in a C# script. Then I put the DLL file into Plugins/Android folder. But it gives the following error:
Assets/Core.cs(70,3): error CS0012: The type 'java.lang.Object' is defined in an assembly that is not referenced. Consider adding a reference to assembly 'IKVM.OpenJDK.Core, Version=7.2.4630.5, Culture=neutral, PublicKeyToken=13235d27fcbfff58'
Corresponding line in Core.cs:
FLAC_FileEncoder flacEncoder = new FLAC_FileEncoder();
How can I fix it? If there is a way to use the .jar file directly, I'm also okay with that.
Fixed it by copying IKVM.OpenJDK.Core.dll to the same folder (Plugins/Android).
Related
Here is the make file i am using to generate and JAVA module which i am importing in another module. While compiling it, the build breaks saying
error: 'out/target/common/obj/JAVA_LIBRARIES/android.hardware.automotive.vehicle#2.0-java_intermediates/classes.dex.toc', needed by 'out/target/common/obj/JAVA_LIBRARIES/vendor.harman.hardware.automotive.vehicle.fca_r1#1.0-java_intermediates/with-local/classes.dex', missing and no known rule to make it
Any suggestion on how to generate a .toc file in general?
Anything specific to be added in the make file?
Usually such toc file will be auto generated during fullbuild, but if it is missing when you build single module you can manually generate the classes.dex.toc with the following command:
dexdump2 classes.dex >> classes.dex.toc
If you want to know the details, please read the sourcecode of android build system: _transform_dex-to-toc
https://android.googlesource.com/platform/build/+/f972a4a980660d2347ace8fdc7c668403c0e9697/core/definitions.mk
I'll try to illustrate the problem as simple as I can.
I have a JAR file, which I extracted using Winrar. (The jar file contains an open source android library).
I want to modify this JAR file by adding a new class to the library.
So here are my steps:
First, I created a class using Eclipse and set the package name same as the android's library package name.
Second, I copied this java File to the folder of the other java files in the library.
Third, I tried to compile the JAVA file via the CMD using javac.
The path of the new java file and the other .JAVA and .CLASS files of the library is: C:\com\example\core\
The name of the new java file would be: "MyNewClass.java"
The command I run via the CMD is: javac C:\com\example\core\MyNewClass.java
But, during the compilation I get many errors saying: Cannot find symbols.
I've been looking up for a solution of this problem but couldn't figure how to solve it and make the new JAR File having another class that I created seperately.
What am I missing?
As per earlier comments:
Rather than trying to modify the JAR, you can get access to the full source code of the Universal Image Loader library by cloning the repository using git or hitting "Download ZIP" on the righthand side of the page you linked.
Once you have the source, import the library in your IDE. From there on you'll be able to build the whole thing from scratch, make any adjustments/modifications you like, etc.
Your classpath might be wrong or there might be some mistake in package name.
When a Java program is being compiled the compiler it creates a list of all the identifiers in use. If it can't find what an identifier refers to it cannot complete the compilation. This is what the cannot find symbol error message is saying, it doesn't have enough information to piece together what the Java code wants to execute.
Try:
javac -cp com/* C:\com\example\core\MyNewClass.java
That should make the compiler aware of all the other classes under com/...
java and I have its own .so file, I made a new android project and I import the class.java and the so file under lib\armeabi\lib.so I tried to compile it but I got errors about can't find the library.
I did many searches and found to make a new so file. I have the header file and I gone to androidtools add native support and created empty cpp. I copied the header content to the cpp then in android.mk I matched the nessecary and then I compiled i am getting some errors
java.lang.UnsatisfiedLinkError: Couldn't load FXTEST from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.example.fxtest-.apk,libraryPath=/data/app-lib/com.example.fxtest-2]: findLibrary returned null
I created jni_onload method and still got errors Any Idea? Let me know if you want some pictures, I will attach
I suppose you might try to provide Java with the path to you native library with the following java option:
-Djava.library.path=/Path/To/You/File
I am not an android developer though, so I might be wrong.
I want to acess class file from bin folder in android.
I was doing it using
File f = new File("/bin/filename.class");
Its working fine in java but in android giving path doesnt work, so
please suggest me other way to access class file of any java file in android.
You can't access file like
File f = new File("/bin/filename.class");
from bin folder. Android can't recognize this path.
Java .class files are converted to Dalvik Executable (.dex), in your apk there won't be any .class files, just one single dex file called classes.dex.
I think this post from Android Developers blog might help you: http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html
I have created a Java Project using Eclipse. Inside it I have create a package (named generators) and I have moved inside it my generate.mtl file and Generate.java class.
After it I've created a java class and i try to call the method doGenerate() of a "Generate" object.
Doing it on the console appare this message:
java.io.IOException: 'generate.emtl' not found
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:307)
at generatore.Generate.(Generate.java:90)
at tests.MainTest.main(MainTest.java:49)
Why?
What I have to do?
Thank you
The 'generate.emtl' file Acceleo is searching for is the compiled version of your 'generate.mtl' file (kind of what a '.class' is to a '.java'). When in Eclipse, this file is compiled automatically provided that you're using an "Acceleo Project" and not a regular Java project.
However, you have to either manually compile it or copy it beside your "mtl" file when in standalone.