Skip to content

NoSuchMethodError #5

Description

@NeariX67

Hey,
i wasnt quite able to make this project runable.

Neither implementation example of your readme seem to work for me.

Here's my Class:

package com.nearix.test;

import java.util.Collection;
import java.util.List;

import de.matthiasfisch.mysticlight4j.Device;
import de.matthiasfisch.mysticlight4j.LED;
import de.matthiasfisch.mysticlight4j.MysticLight4j;
import de.matthiasfisch.mysticlight4j.api.DeviceInfo;
import de.matthiasfisch.mysticlight4j.api.LedInfo;
import de.matthiasfisch.mysticlight4j.api.MysticLightAPI;

public class Main {
public static void main(String[] args) {
MysticLight4j mysticLight = new MysticLight4j();
Collection devices = mysticLight.getAllAvailableDevices();
for (Device device : devices) {
String id = device.getIdentifier(); // Unique ID of the device
String name = device.getName(); // Display name of the device
System.out.println(name);
List leds = device.getLEDs(); // The LED groups on the device
}

// Console:
// C:\Users\NeariX\OneDrive - OSZ IMT\Coding\Eclipse\WorkSpace\MSI Mystic Light Java
// Exception in thread "main" java.lang.NoSuchMethodError:
// at de.matthiasfisch.mysticlight4j.api.MysticLightNativeBinding.getLedInfo(Native Method)
// at de.matthiasfisch.mysticlight4j.api.MysticLightAPI.getLedInfo(MysticLightAPI.java:151)
// at de.matthiasfisch.mysticlight4j.LED.(LED.java:33)
// at de.matthiasfisch.mysticlight4j.Device.lambda$0(Device.java:29)
// at java.util.stream.IntPipeline$4$1.accept(IntPipeline.java:250)
// at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:110)
// at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:693)
// at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
// at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
// at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
// at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
// at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
// at de.matthiasfisch.mysticlight4j.Device.(Device.java:30)
// at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
// at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
// at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
// at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
// at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
// at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
// at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
// at de.matthiasfisch.mysticlight4j.MysticLight4j.getAllAvailableDevices(MysticLight4j.java:64)
// at com.nearix.test.Main.main(Main.java:13)

	MysticLightAPI.initialize();  
	DeviceInfo[] devices = MysticLightAPI.getDeviceInfo();  
	for (DeviceInfo device : devices) {  
	    // Prints the unique identifier of the device  
	  System.out.println(device.getDeviceType());  
	  System.out.println("LED groups for this device:");  
	 for (int i = 0; i < device.getLedCount(); i++) {  
	        LedInfo led = MysticLightAPI.getLedInfo(device.getDeviceType(), i);  
	  System.out.println(led.getName());  
	  }  
	}

// Console:
// MSI_MB
// LED groups for this device:
// Exception in thread "main" java.lang.NoSuchMethodError:
// at de.matthiasfisch.mysticlight4j.api.MysticLightNativeBinding.getLedInfo(Native Method)
// at de.matthiasfisch.mysticlight4j.api.MysticLightAPI.getLedInfo(MysticLightAPI.java:151)
// at com.nearix.test.Main.main(Main.java:25)

}

}

It doesn't seem to find the getLedInfo Method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions