arduleader icon indicating copy to clipboard operation
arduleader copied to clipboard

java.lang.NumberFormatException: For input string: ""

Open rushtehrani opened this issue 11 years ago • 3 comments

I am following the steps from this section https://github.com/geeksville/arduleader#building-andropilot, and the exception is thrown after I run sbt.

Please note the following:

  • sbt version 0.13.0 and the corresponding sbt-launcher.jar file are installed.
  • Both Android and Google version 17 and 19 libraries installed.

My assumption is that these are all backwards compatible but I could be wrong.

Please see the full error log below:

[info] Loading project definition from /Users/rush/Documents/adt/workspace/andropilot/arduleader/project
[debug] Running task... Cancelable: false, check cycles: false
[debug] 
[debug] Initial source changes: 
[debug]     removed:Set()
[debug]     added: Set()
[debug]     modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug] 
[debug] Sources indirectly invalidated by:
[debug]     product: Set()
[debug]     binary dep: Set()
[debug]     external source: Set()
[debug] Initially invalidated: Set()
[debug] Copy resource mappings: 
[debug]     
java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:470)
    at java.lang.Integer.parseInt(Integer.java:499)
    at scala.collection.immutable.StringLike$class.toInt(StringLike.scala:231)
    at scala.collection.immutable.StringOps.toInt(StringOps.scala:31)
    at sbtandroid.AndroidPath$$anonfun$sbtandroid$AndroidPath$$determineBuildToolsVersion$2$$anonfun$1.apply(AndroidPath.scala:21)
    at sbtandroid.AndroidPath$$anonfun$sbtandroid$AndroidPath$$determineBuildToolsVersion$2$$anonfun$1.apply(AndroidPath.scala:21)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
    at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:38)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
    at scala.collection.mutable.ArrayOps.map(ArrayOps.scala:38)
    at sbtandroid.AndroidPath$$anonfun$sbtandroid$AndroidPath$$determineBuildToolsVersion$2.apply(AndroidPath.scala:21)
    at sbtandroid.AndroidPath$$anonfun$sbtandroid$AndroidPath$$determineBuildToolsVersion$2.apply(AndroidPath.scala:18)
    at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:52)
    at scala.collection.IndexedSeqOptimized$class.reduceLeft(IndexedSeqOptimized.scala:69)
    at scala.collection.mutable.ArrayOps.reduceLeft(ArrayOps.scala:38)
    at sbtandroid.AndroidPath$.sbtandroid$AndroidPath$$determineBuildToolsVersion(AndroidPath.scala:18)
    at sbtandroid.AndroidPath$$anonfun$settings$5.apply(AndroidPath.scala:40)
    at sbtandroid.AndroidPath$$anonfun$settings$5.apply(AndroidPath.scala:40)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
    at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$single$1.apply(INode.scala:155)
    at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$single$1.apply(INode.scala:155)
    at sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:173)
    at sbt.EvaluateSettings$INode.evaluate(INode.scala:129)
    at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:64)
    at sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:73)
    at sbt.EvaluateSettings$$anon$3.run(INode.scala:69)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)
[error] java.lang.NumberFormatException: For input string: ""

rushtehrani avatar Nov 12 '13 07:11 rushtehrani

This likely has to do with sbt and the fact that it's not finding the 'ANDROID_SDK_HOME' env variable. It is also most likely a Mac OSX issue. I'll keep digging and will post my findings as it may be useful to other developers using Macs...

rushtehrani avatar Nov 12 '13 08:11 rushtehrani

Doesn't look like this is an issue with the environment variable. I unset the variable and run sbt and it prompts me with:

[error] Android SDK not found. You might need to set ANDROID_SDK_HOME or ANDROID_SDK_ROOT or ANDROID_HOME

I cleared all the sbt cache files and rebuilt everything using sbt version 0.12.1 and set the environment variable and I still get the same "java.lang.NumberFormatException" mentioned above.

rushtehrani avatar Nov 12 '13 22:11 rushtehrani

You did sbt clean clean-files or only sbt clean because I did sbt clean clean-files it and it worked for me.

VincentMolinie avatar Jun 28 '16 10:06 VincentMolinie