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

Bug: Parsing minimum version number crashes for single-digit version numbers #1222

Closed
noblemaster opened this issue Dec 31, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@noblemaster
Copy link

RoboVM grade build crashes if the "MinimumOSVersion" defined in Info.plist.xm is a single-digit value (e.g. "7"). A StringIndexOutOfBoundsException is thrown.

Crashing Info.plist.xml:

  <key>MinimumOSVersion</key>
  <string>7</string>

Working Info.plist.xml:

   <key>MinimumOSVersion</key>
   <string>7.0</string>

File & Line# in Question:

majorVersionNumber = Integer.parseInt(minVersion.substring(0, minVersion.indexOf('.')));

Suggested fixes:

  • Catch "StringIndexOutOfBoundsException" in addition to "NumberFormatException" otherwise the resulting error message is nonsensical (I didn't have a clue what broke because the error message in the try-catch isn't reached because the exception is not a number format exception).
  • Allow single-digit numbers for MinimumOSVersion. I think that's supported by iOS anyway.
@ntherning ntherning added the bug label Jan 13, 2016
@ntherning ntherning added this to the 1.13 milestone Jan 13, 2016
@ntherning
Copy link
Contributor

Looks like at least the iOS simulator can handle single digit numbers. We should make sure it doesn't fail within RoboVM.

@ntherning ntherning modified the milestones: 1.14, 1.13 Jan 27, 2016
@ntherning ntherning self-assigned this Jan 28, 2016
@ntherning
Copy link
Contributor

Fixed!

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

No branches or pull requests

2 participants