java.lang.NoClassDefFoundError: Failed resolution of: Lcs/min2phase/Search; what does it means

is it because of old compiler in app inventor or dx won't compile is there any way

Show all the annotations you're using.

@UsesLibraries(libraries = "nexcube.jar")

@DesignerComponent(version = 1, description = "this extension is used to make cube solving easy made by
" +"hifi apps. contact here-
category = ComponentCategory.EXTENSION,
nonVisible = true,
iconName = "")

@SimpleObject(external = true)
public class nexcube extends AndroidNonvisibleComponent {

private ComponentContainer container;
private Context context;
 * @param container container, component will be placed in.

public nexcube (ComponentContainer container) {
this.container = container;
this.context = container.$context();

@SimpleFunction(description = ""){
public String a(String b){
//a code for cube its secret i cant show this

You may want to try invoking dx.jar directly on your extension's libraries to see if it outputs any errors. In App Inventor we use multidex and so in theory it should split up the code into more classes.dex files to accommodate larger libraries, but it could be an issue with how you compiled the library sources.

please remember the naming conventions



What you mean by this I can't understand what should I do now

where is it where should i put

dx.jar is found in lib/android/tools/. You run it like so:

java -jar lib/android/tools/dx.jar [options]

So if you do:

java -jar lib/android/tools/dx.jar --dex --output classes.dex path/to/your/classes path/to/your/libs

then you can see whatever errors dex generates for your extension.

If that doesn't yield any errors, consider running App Inventor locally using the dev server along with a local build server. You should be able to look at the raw console output to see if there are any other issues reported.

What is my classes,

you mean this as the .jar lib i imported

initially i had 4 java code file need to be imported but as i need to import a jar file i first converted the 4 java file to 4 class file using

javac *.java

then to convert the 4 class file to jar i used

jar cf JarExample.jar *.class

u mean the 4 class files

You can also just give the jar file since dex will read all class files from within it.

C:\Users\GOD\appinventor-sources\appinventor\lib\android\tools>java - jar dx.jar --dex C:\Users\GOD\appinventor-sources\appinventor\lib\nexcube\nexcube.jar
Unrecognized option: -
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

You didn't run the command properly. If you look at my post you can note that there is not a space between the - and jar.

1 Like

ur right

for now this is the error

C:\Users\GOD\appinventor-sources\appinventor\lib\android\tools>java -jar dx.jar --dex C:\Users\GOD\appinventor-sources\appinventor\lib\nexcube\nexcube.jar
Picked up _JAVA_OPTIONS: -Xmx1024m

class name (cs/min2phase/CoordCube) does not match path (CoordCube.class)
...while parsing CoordCube.class
1 error; aborting

it says the error for the first java code file (i have 4 code file error coressponds to 1 of it) the file name is CoordCube the code file package name was

package cs.min2phase;

and the structure of the code will be

package cs.min2phase;

class CoordCube {
//code here i din't post code if required i will PM

so what should i do now

The error indicates that you didn't package the jar correctly. The class files should be in subdirectories corresponding to their package.

u mean the 4 class file

In folder asdfg I have 4 class file as u said to place in folder manner I placed
Asdfg\a\s\d\my 4 class file
So what is command I need to put in cmd

Thanks a lot compiled

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.