Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - No text appearing #10

Open
shaks786 opened this issue Jun 18, 2013 · 13 comments
Open

Android - No text appearing #10

shaks786 opened this issue Jun 18, 2013 · 13 comments

Comments

@shaks786
Copy link

I've updated the SheenFigure library, and now the text doesn't seem to appear at all?

@mta452
Copy link
Owner

mta452 commented Jun 19, 2013

Sorry for the inconvenience. I intended to commit only ios related code but mistakenly committed android code as well on which I'm currently working.

Please use older version for the time being.

@mta452
Copy link
Owner

mta452 commented Jul 10, 2013

Just pushed a newer version with glyph cache support. Hope it solves your problems.

@shaks786
Copy link
Author

Sorry for late reply, now I keep getting the following error, 08-18 23:23:07.445: E/AndroidRuntime(807): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load SheenFigureJNI: findLibrary returned null

Any ideas? Been trying to figure it out for a few hours now (This is with the new Demo app you recently pushed out)

@mta452
Copy link
Owner

mta452 commented Aug 19, 2013

It is possible that jni is not being compiled.
In new version, there are two projects. The First one is SheenFigure-Android which compiles native library and the second one is demo project which loads library from first project.
You'll have to configure android NDK on first project.

@shaks786
Copy link
Author

I've set it up NDK on the first project and used the demo project to add it as a library, but it just doesn't seem to compile the native code when I run the application. The NDK setup I has is shown below:
screen shot 2013-08-20 at 18 36 07

@mta452
Copy link
Owner

mta452 commented Aug 20, 2013

While compiling the project, look at console window to see if it tells any errors in the native code.

@shaks786
Copy link
Author

no errors in console but the console doesn't even show any of the native code compiling, like how it usually should do..

@mta452
Copy link
Owner

mta452 commented Aug 21, 2013

Maybe your NDK is not being triggered. Try changing the working directory from workspace-project to absolute path.

@shaks786
Copy link
Author

NDK seems to run when I just start Eclipse, but not when I build/run the app. When Eclipse starts NDK greets me with this:

/SSText.c:235:2: warning: passing argument 7 of 'SFTextShowString' from incompatible pointer type [enabled by default]
jni/../../SheenFigure/SFGraphics/SFText.h:57:5: note: expected 'SFGlyphRenderFunction' but argument is of type 'void (*)(void *, SFGlyph, SFFloat, SFFloat, void *)'

@mta452
Copy link
Owner

mta452 commented Aug 22, 2013

Are you sure you are using latest files? SSText.c is only 183 lines long then how can there be an error at 235 line?
Here is what I think you must do.

  1. Delete any existing projects, download a fresh copy and import it in eclipse.
  2. In eclipse, goto project menu and disable "Build Automatically".
  3. Open NDK configuration. In "Main" tab, set working directory to "SheenFigure-Android". In "Build Options" tab, enable "Allocate Console", "After a Clean" and "During manual builds".
  4. Right click on the project and hit "Build Project". Watch the console window and see the progress.

If you still encounter issues, use this prebuild native library:
Just copy libs folder to SheenFigure-Android project. Now it should be loaded and you shouldn't have UnsatisfiedLinkError.

@mta452
Copy link
Owner

mta452 commented Aug 22, 2013

@shaks786
Copy link
Author

YES! Finally it works, turns out I was missing step 4 (Building the project), Thanks a lot. One final (hopefully) question - does SheenFigure at the moment only support one widget per layout? I tried having multiple instances of SheenFigure TextView widget within the same layout and got some NullPointer exception. Thanks again

@shaks786
Copy link
Author

Apologies, ignore the above, I had forgot to set the font on each TextView hence the nullpointer error. Seems to work fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants