missing symbol complaint in Android build

78 views
Skip to first unread message

Dave Dyer

unread,
Jan 14, 2016, 9:23:26 PM1/14/16
to CodenameOne Discussions

    [javac] G:\share\projects\eclipse\boardspace core CN1\src\lib\G.java:1954: error: cannot find symbol
    [javac]         if(f.isTTFNativeFont() && (f.getPixelSize()==size))
    [javac]             ^
    [javac]   symbol:   method isTTFNativeFont()

IsTTFNativeFont() is a public api in font.Java, which has been there since 11/16/2015


Shai Almog

unread,
Jan 14, 2016, 11:10:23 PM1/14/16
to CodenameOne Discussions
I'm guessing you are building against an older version of the libs then.

Dave Dyer

unread,
Jan 14, 2016, 11:30:31 PM1/14/16
to CodenameOne Discussions

I built my installation well after the date in question.  What is the process of getting
the eclipse plugin in sync with the latest official sources?

Shai Almog

unread,
Jan 16, 2016, 1:04:07 AM1/16/16
to CodenameOne Discussions
We push out a plugin or lib update occasionally (roughly once every 3-5 weeks). When we do that you can either just send a build which will fetch the update or use the "update client libs" button in the Codename One section of the project properties.

Dave Dyer

unread,
Jan 16, 2016, 3:54:34 AM1/16/16
to CodenameOne Discussions
so if i get you to accept a new public method, it may be 3-5 weeks before I can use it in builds?

Shai Almog

unread,
Jan 16, 2016, 11:30:26 PM1/16/16
to CodenameOne Discussions
http://stackoverflow.com/questions/34830911/how-does-a-codename-one-update-work/34835039

If you use the source as I understand you do, you don't need to wait much. The servers already have the change.

Dave Dyer

unread,
Jan 17, 2016, 3:18:20 AM1/17/16
to CodenameOne Discussions

That may be the theory, but the practice seems to be less than faithful to the theory.  The isTTf change went into the sources in november,
but I still can't submit builds that use it.

On the other hand, the repairs I made to the sockets code seem to be in place, thanks.

Shai Almog

unread,
Jan 17, 2016, 10:55:47 PM1/17/16
to CodenameOne Discussions
That's related to the classpath you are using. You are compiling against the jar instead of against your local sources. The compilation error you get is local and the changes are already in the sources.

Notice that within the build.xml there is a section that validates that you aren't using an unsupported API before sending a build. You need to reference your modified jars in order for this to work.

Dave Dyer

unread,
Jan 17, 2016, 11:46:54 PM1/17/16
to CodenameOne Discussions
Thanks, that gives me a direction to look in.  In the eclipse environment there are no explicitly created jars for the codename1 codebase,
but I presume if I remove the references to the obsolete jars in the build script, I'll discover a way to use the live environment.

Dave Dyer

unread,
Jan 18, 2016, 3:25:15 PM1/18/16
to CodenameOne Discussions
Ok, I modified my build process to build against my sources,  and I can now build using the
recently added methods.  These builds (android) succeed, but if they actually use the new
APIs they crash without a trace of cause.   I would guess that the new APIs are not actually
available on your build servers, but I'm disturbed that the builds succeeded.

How would I get more information (more than zero) out of the android device in this case?

--

Shai Almog

unread,
Jan 19, 2016, 12:30:33 AM1/19/16
to CodenameOne Discussions
No its all implemented.

Connect the device with a cable and the DDMS tool from the Android SDK to see the actual printouts of the device.

Dave Dyer

unread,
Jan 22, 2016, 9:21:57 PM1/22/16
to CodenameOne Discussions
I got to the bottom of this.  When you installed my getPixelSize() api, you fixed the text style
to conform to your formatting standards, but you also changed the signature from double to
float.   public double getPixelSize()  became public float pixelSize()

The jars I was building embedded/expected the original signature, and when invoked, resulted
in this error

 java.lang.NoSuchMethodError: No virtual method getPixelSize()D in class Lcom/codename1/ui/Font; or its super classes (declaration of 'com.codename1.ui.Font' appears in /data/app/com.boardspace-1/base.apk)


Dave Dyer

unread,
Jan 22, 2016, 9:23:15 PM1/22/16
to CodenameOne Discussions

All this is pretty normal, except that your build process did not generate any complaint
about the mismatched signatures.

 

Shai Almog

unread,
Jan 23, 2016, 1:37:19 AM1/23/16
to CodenameOne Discussions
That's because Android links classes dynamically so we can't tell you compiled against a "broken" jar.

Dave Dyer

unread,
Jan 23, 2016, 2:37:00 AM1/23/16
to CodenameOne Discussions
yes, but when your build process encountered my request for a method teturning a double, that was not checked against your list of functions that were available to be linked to.

the client side makes that check before submitting the build,
why isn't the same check made in the actual build?

Shai Almog

unread,
Jan 23, 2016, 11:36:13 PM1/23/16
to CodenameOne Discussions
The client side compiles your code and javac makes that check.
We get pre-compiled code which "should work". We don't need to check it for Android build. Adding such a check would just slow the build as it was already done on the client side.

Dave Dyer

unread,
Jan 24, 2016, 1:28:02 AM1/24/16
to CodenameOne Discussions
True if your build process is perfectly synchronized with the client's.  That's manifestly not true.  Current case in point - you installed a different change
than I submitted.  Any number of accidents could result in a mismatch like this, and as we see, they are only manifest at runtime in deployed applications; which is not a very satisfactory q/a procedure.

Shai Almog

unread,
Jan 24, 2016, 10:49:01 PM1/24/16
to CodenameOne Discussions
If you hack the source code your safety net is smaller.
Our servers have no way of knowing you did it so adding such verification for Android would slow down builds for everyone.

Dave Dyer

unread,
Jan 24, 2016, 11:51:10 PM1/24/16
to CodenameOne Discussions
if you are on the cutting edge, contributing to the development of the product, you deserve the best safety net available.
Cycles are cheap. People time is expensive.
Errors completely on your side are possible too.
It could be an option.

Shai Almog

unread,
Jan 25, 2016, 10:34:56 PM1/25/16
to CodenameOne Discussions
If you are on the cutting edge you should be aware of the risks and be cautious. Despite the myth CPU cycles are not cheap and do add up both in servers and mobiles.

Dave Dyer

unread,
Feb 2, 2016, 1:00:22 PM2/2/16
to CodenameOne Discussions

Another instance of unnecessary arrows in my back.  I accidentally included javafx in by project's
build path, which allowed me to use Line2D methods.  This was not detected as an error by either
the local or the remote build process, and resulted in an android runtime error, but only when I actually
tried to use the Line2D methods.

Having this kind of latent error in delivery builds is like leaving a bomb in the basement.

+ $0.02



Shai Almog

unread,
Feb 2, 2016, 11:18:03 PM2/2/16
to CodenameOne Discussions
That's only when you work with the sources and since you disabled the compile checks on the client.
Reply all
Reply to author
Forward
0 new messages