• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error on Nokia 6600 phone

 
Mark Spritzler
ranger
Sheriff
Posts: 17287
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I finally got my jar file downloaded to a phone, but I got an error saying
getWidth(); invalid method call.
This call is in the paint method of a Canvas, the method is called on the Graphics object in the paint method.
Can anyone think of why I got this error? Could the Obfuscator on Sun's wireless toolkit have messed the code up such that it won't run?
Thanks for any ideas
Mark
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Had the same problem with the obfusticator. So, you just have to handcode the width for now.
 
Mark Spritzler
ranger
Sheriff
Posts: 17287
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh, I'll just not Obfuscate it. Man, just trying to spell it is difficult.
Mark
 
Carlos Quiroz
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Try compiling with the targetset to JDK 1.2 like
javac -target 1.2 .....
Regards
 
Mark Spritzler
ranger
Sheriff
Posts: 17287
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carlos, can you do that through the Wireless Toolkit?
Mark
 
Carlos Quiroz
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I'm not sure. I normally build using an ant build file where you can indicate that. I also use the antenna build tasks.
Hope it helps
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not think the compile target is the problem: I always compiled to 1.2 (the default of the JDK v1.4 javac) unless the preverify complains, in which case I change the compile target to v1.1.
That particular error with getWidth() only happens when the following are true:
1. The application is deployed on Nokia devices or emulators.
2. The application is obfuscated.
I asked several people inside Nokia and could not get a satisfactory answer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!