infinitered / infinitered/bluepotion

Invalid Character

Open
#95 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Ruby
Stars
74
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Hey all,

I tried making an app with a dash in the name `time-clock` and didn't realize the dash was killing `newclear` for a while. The error on `rake newclear` looked like this:

```
KC:time-clock$ rake newclear
================================================================================
A new version of RubyMotion is available. Run `sudo motion update' to upgrade.
================================================================================

Cleaning Project...
fatal: Not a git repository (or any of the parent directories): .git
Delete ./build
Delete /Users/KC/Library/RubyMotion/build

Bundling...

Setting up gradle automation dependencies...
fatal: Not a git repository (or any of the parent directories): .git
[warning] To avoid issues you should install `Extras/Android Support Repository`. Open the gui to install it : /Users/KC/.rubymotion-android/sdk/tools/android
[warning] To avoid issues you should install `Extras/Google Repository`. Open the gui to install it : /Users/KC/.rubymotion-android/sdk/tools/android
Building project...
for device
================================================================================
A new version of RubyMotion is available. Run `sudo motion update' to upgrade.
================================================================================

fatal: Not a git repository (or any of the parent directories): .git
Create ./build/Development-16/AndroidManifest.xml
(skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*')
(skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*')
./build/Development-16/AndroidManifest.xml:2: Tag attribute package has invalid character '-'.
rake aborted!
Command failed with status (1): ["/Users/KC/.rubymotion-android/sdk/build-t...]
/Library/RubyMotion/lib/motion/project/template/android.rb:188:in `block in '
/Library/RubyMotion/lib/motion/project/template/android.rb:755:in `block (2 levels) in '
/Library/RubyMotion/lib/motion/project/template/android.rb:755:in `each'
/Library/RubyMotion/lib/motion/project/template/android.rb:755:in `block in '
/Users/KC/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/Users/KC/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `'
Tasks: TOP => build
(See full trace by running task with --trace)
```

I can see it now, but I first updated ruby motion, then I thought it might be the `fatal` thing about it not being a git repository because of the warnings:

```
[warning] To avoid issues you should install `Extras/Android Support Repository`. Open the gui to install it : /Users/KC/.rubymotion-android/sdk/tools/android
[warning] To avoid issues you should install `Extras/Google Repository`. Open the gui to install it : /Users/KC/.rubymotion-android/sdk/tools/android
```

After installing those I was still getting `fatal not a git repo . . .` so I created one and then I get

```
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
```

so I add all and commit it and finally I get

```
KC:time-clock$ rake newclear

Cleaning Project...
Delete ./build
Delete /Users/KC/Library/RubyMotion/build
Delete vendor/Gradle

Bundling...

Setting up gradle automation dependencies...
Building project...
for device
Create ./build/Development-16/AndroidManifest.xml
(skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*')
(skipping file '.gitkeep' due to ANDROID_AAPT_IGNORE pattern '.*')
./build/Development-16/AndroidManifest.xml:2: Tag attribute package has invalid character '-'.
rake aborted!
Command failed with status (1): ["/Users/KC/.rubymotion-android/sdk/build-t...]
/Library/RubyMotion/lib/motion/project/template/android.rb:188:in `block in '
/Library/RubyMotion/lib/motion/project/template/android.rb:758:in `block (2 levels) in '
/Library/RubyMotion/lib/motion/project/template/android.rb:758:in `each'
/Library/RubyMotion/lib/motion/project/template/android.rb:758:in `block in '
/Users/KC/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/Users/KC/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `'
Tasks: TOP => build
(See full trace by running task with --trace)
```

And this one tipped me off that the line before `rake aborted!` is the issue :blush:

I'm telling you all this so that:
1. I can request some kind of error checking / fixing like `bluepotion create time-clock` renames the app to `time_clock` or something like that.
2. I can demonstrate the way my brain approached the stack trace in case it's useful in designing the error process.

Thanks for the great gem!

-KC

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with `bluepotion create time-clock` followed by `rake newclear`, and inspect the generated AndroidManifest.xml and the command entry point. Determine where the app name becomes the manifest package value. Done means invalid names are caught or corrected before the build, with a clear result for names containing a dash.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.