I am new to Android development so I apologize for anything I forget to clarify. I am working on a group project in Android studio, checked out from Git. I previously was able to build the project fine, but after a recent pull I suddenly have many compilation errors coming from the package

projectname\tess two\jni\com_googlecode_tesseract_android\src\java\com\google

It seems that I have a big mess of unresolved symbols, like "cannot resolve symbol (piccolo2d, Color, event, swing), which appear at import statements like these at the top of my classes underneath this project

import org.piccolo2d.*;

import java.awt.Color;

import java.awt.event.*;

import javax.swing.Timer;

I am wondering what might cause these unresolved symbols. I have tried deleting the project and re-pulling it from Git, re-building the project, etc.

Any help or direction would be great, I realize I did not give a lot of context, mostly because I myself am confused at where these problems could suddenly come from.

有帮助吗?

解决方案

Anything related to awt or swing will inevitably fail; those toolkits are not available on Android. Someone or something is accidentally importing symbols from the wrong place. It's probably android.graphics.Color you want instead of java.awt.Color, etc.

I suspect that if you delete those imports, and then select Optimize Imports from the Code menu in Android Studio, the correct symbols will be imported.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top