HipByte / Flow

Cross-platform libraries for RubyMotion
BSD 2-Clause "Simplified" License
141 stars 29 forks source link

[Android] ERROR! Class `ActivityIndicator' already defined with a different super class (`View') #19

Closed Watson1978 closed 8 years ago

Watson1978 commented 8 years ago

With latest commits, the build error will be occurred when build "samples/ui_demo" app with rake android:emulator

$ rake android:emulator

... snip ...

   Compile /Users/watson/prj/Flow/lib/../flow/ui/android/image.rb
   Compile /Users/watson/prj/Flow/lib/../flow/ui/android/button.rb
   Compile /Users/watson/prj/Flow/lib/../flow/ui/android/font.rb
   Compile /Users/watson/prj/Flow/lib/../flow/ui/android/list.rb
   Compile /Users/watson/prj/Flow/lib/../flow/ui/android/activity_indicator.rb
   Compile /Users/watson/prj/Flow/lib/../flow/ui/android/view.rb
   Compile /Users/watson/prj/Flow/lib/../flow/ui/android/navigation.rb
   Compile /Users/watson/prj/Flow/lib/../flow/ui/android/label.rb
   Compile /Users/watson/prj/Flow/lib/../flow/ui/android/ui.rb
    Create build/android/Development-23/lib/x86/libpayload.so
    Create build/android/Development-23/lib/x86/gdbserver
    Create build/android/Development-23/lib/x86/gdb.setup
    ERROR! Class `ActivityIndicator' already defined with a different super class (`View')

At least, "samples/ui_demo" works commits until https://github.com/HipByte/Flow/commit/42c33cc4abff6ac736e7c0977835646e39a86247

Watson1978 commented 8 years ago

This issue occurs with new project

$ motion create --template=flow Hello
$ cd Hello

$ rake android:emulator

... snip ...

   Compile /Users/watson/.rbenv/versions/2.4.0-preview1/lib/ruby/gems/2.4.0/gems/motion-flow-0.1.1/lib/../flow/ui/android/camera.rb
   Compile /Users/watson/.rbenv/versions/2.4.0-preview1/lib/ruby/gems/2.4.0/gems/motion-flow-0.1.1/lib/../flow/ui/android/ui.rb
   Compile /Users/watson/.rbenv/versions/2.4.0-preview1/lib/ruby/gems/2.4.0/gems/motion-flow-0.1.1/lib/../flow/ui/android/view.rb
   Compile /Users/watson/.rbenv/versions/2.4.0-preview1/lib/ruby/gems/2.4.0/gems/motion-flow-0.1.1/lib/../flow/ui/android/label.rb
   Compile /Users/watson/.rbenv/versions/2.4.0-preview1/lib/ruby/gems/2.4.0/gems/motion-flow-0.1.1/lib/../flow/ui/android/screen.rb
   Compile /Users/watson/.rbenv/versions/2.4.0-preview1/lib/ruby/gems/2.4.0/gems/motion-flow-0.1.1/lib/../flow/ui/ui.rb
   Compile /Users/watson/.rbenv/versions/2.4.0-preview1/lib/ruby/gems/2.4.0/gems/motion-flow-0.1.1/lib/../flow/ui/android/text.rb
   Compile /Users/watson/.rbenv/versions/2.4.0-preview1/lib/ruby/gems/2.4.0/gems/motion-flow-0.1.1/lib/../flow/ui/android/web.rb
    Create build/android/Development-23/lib/x86/libpayload.so
    Create build/android/Development-23/lib/x86/gdbserver
    Create build/android/Development-23/lib/x86/gdb.setup
    ERROR! Class `ActivityIndicator' already defined with a different super class (`View')
Watson1978 commented 8 years ago

This issue is occurred since 807ecfd6cfb5cc49e9e9f63167daafc14a0e7da0 patch

Watson1978 commented 8 years ago

ActivityIndicator had defined with different namespace of super class.

https://github.com/HipByte/Flow/blob/807ecfd6cfb5cc49e9e9f63167daafc14a0e7da0/flow/ui/activity_indicator.rb

module UI
  class ActivityIndicator < View

...

https://github.com/HipByte/Flow/blob/3ee460665a3906735943b1fa1d74253b2e060933/flow/ui/android/activity_indicator.rb

module UI
  class ActivityIndicator < UI::View

...

Then, when generate Java files from .map, this error was occurred at https://github.com/HipByte/RubyMotion/blob/master/lib/motion/project/template/android.rb#L416-L418

jjaffeux commented 8 years ago

@Watson1978 this file https://github.com/HipByte/Flow/blob/807ecfd6cfb5cc49e9e9f63167daafc14a0e7da0/flow/ui/activity_indicator.rb doesnt exist anymore, or am I mistaking ?

Watson1978 commented 8 years ago

@jjaffeux you're right. I had just investigated the root of this issue more.

jjaffeux commented 8 years ago

Ok ;)