java.awt.color on android

See original GitHub issue

I am having this issue on windows and on android using a part of this library. I am only using it to create OSC Messages with arguments and to parse it to a byteBuffer so I can send it via my own protocol.

Error log on android: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/Color; at com.illposed.osc.argument.handler.AwtColorArgumentHandler.getJavaClass(AwtColorArgumentHandler.java:43) at com.illposed.osc.OSCSerializer.<init>(OSCSerializer.java:101) at com.illposed.osc.OSCSerializerAndParserBuilder.buildSerializer(OSCSerializerAndParserBuilder.java:64)

EDIT: So when I opened this issue I was in a hurry, but after looking at it a couple hours later I think I found the problem, kind of. The issue is with the java.awt.color library, which is not supported on android. I found some older issues and fixes (#43, #49), so that should mean this problem souldn’t exist. But apperantly it does with the latest version (0.8) of this library, maybe something slipt in?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ManuDev9commented, Nov 4, 2021

Hello my friends, this is a Java workaround from the application perspective. No need to pick weird snapshots:

            OSCSerializerAndParserBuilder serializer = new OSCSerializerAndParserBuilder();
            serializer.setUsingDefaultHandlers(false);
            List<ArgumentHandler> defaultParserTypes = Activator.createSerializerTypes();
            defaultParserTypes.remove(16);
            char typeChar = 'a';
            for (ArgumentHandler argumentHandler:defaultParserTypes) {
                serializer.registerArgumentHandler(argumentHandler, typeChar);
                typeChar++;
            }
            mOscPortOut = new OSCPortOut(serializer,
                    new InetSocketAddress(AppData.getOscRemoteAddress(), AppData.getOscPortOutNumber()));

Enjoy

0reactions
hoijuicommented, Nov 30, 2021

Ahh nice, thanks @JellevanAbbema !

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.awt.Color use in Android - Stack Overflow
Here to set the font color I cannot use android.graphics.Color because the method required java.awt.Color as the parameter.
Read more >
Android studio can't find java.awt.Color #51 - GitHub
When using this project on Android studio, when trying to send a message using an OSCPortOut, I get an NoClassDefFoundException for java.awt.Color, which...
Read more >
Color | Android Developers
java.lang.Object. ↳, android.graphics.Color. The Color class provides methods for creating, converting and manipulating colors. Colors have three different ...
Read more >
awt/com/android/internal/awt/AndroidGraphics2D.java
import com.android.internal.graphics.NativeUtils; ... Color;. import java.awt.Composite;. import java.awt.Font; ... private static Color mBc;.
Read more >
Java.awt.Color - General Help - jMonkeyEngine Hub
when I run my Android app, I have a log error saying that the java.awt.Color is missing. So I'd like to know what...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found