HipByte / motion-game

Cross-platform game engine for RubyMotion
BSD 2-Clause "Simplified" License
63 stars 18 forks source link

Unable to start generated project on Android #36

Closed sparkymat closed 8 years ago

sparkymat commented 8 years ago

I created a new project using:

motion create --template=motion-game HelloWorld
cd HelloWorld
rake android:device

I get the following error when it tries to run the app on the device (installation succeeded):

E com/yourcompany/helloworld: Exception raised: NoMethodError: undefined method `start' for #<Class:0x100aa6>

I am using motion-game 1.1.4 with Ruby 2.3.1 on Mac OS X 10.11.6

Edit:

The output of rake android:config is

api_version            : "23"
application_class      : nil
archs                  : ["armv5te", "x86"]
assets_dirs            : ["resources"]
build_dir              : "build/android"
features               : []
files                  : ["./app/application.rb", "./app/main_scene.rb", "/Users/me/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/motion-game-1.1.4/lib/motion-game/android/main_activity.rb"]
icon                   : nil
logs_components        : ["com/yourcompany/helloworld:I", "AndroidRuntime:E", "chromium:E", "dalvikvm:E", "Bundle:E", "art:E"]
main_activity          : "MainActivity"
manifest               : {"xmlns:android"=>"http://schemas.android.com/apk/res/android", "package"=>#<Proc:0x007f9853402548@/Library/RubyMotion/lib/motion/project/template/android/config.rb:145 (lambda)>, "android:versionCode"=>#<Proc:0x007f98534024d0@/Library/RubyMotion/lib/motion/project/template/android/config.rb:147 (lambda)>, "android:versionName"=>#<Proc:0x007f9853402458@/Library/RubyMotion/lib/motion/project/template/android/config.rb:148 (lambda)>}
motiondir              : "/Library/RubyMotion"
name                   : "HelloWorld"
ndk_path               : "/Users/me/.rubymotion-android/ndk"
optional_features      : []
package                : "com.yourcompany.helloworld"
permissions            : []
resources_dirs         : []
sdk_path               : "/Users/me/.rubymotion-android/sdk"
services               : []
specs_dir              : "./spec"
sub_activities         : []
support_libraries      : []
target_api_version     : "24"
theme                  : "@android:style/Theme.Material.Light"
version_code           : "1"
version_name           : "1.0"
m3ltaw4y commented 8 years ago

I have the exact same issue with the default project. As I believe sparkymat mentioned elsewhere, config/android.rb is missing a line of app.package = 'com.example' I corrected this issue, but then ran into the problem described above.

m3ltaw4y commented 8 years ago

Tried on a few different devices: Android: 4.4.4 gives a different error: --------- beginning of main --------- beginning of system E/art ( 8478): Failed writing handshake bytes (-1 of 14): Broken pipe E/art ( 8478): Throwing OutOfMemoryError "PushLocalFrame" E/com/example( 8478): Java exception raised: java.lang.OutOfMemoryError: PushLocalFrame Android 5 works correctly without errors. Android 6 gives the original error (though emulation of Android 6 works properly)

friendlyuis commented 7 years ago

Hi,

I am experiencing this issue as well, and it's already building with armv7:

api_version : "23" application_class : nil archs : ["armv7", "x86"] assets_dirs : ["./assets", "/Library/RubyMotion/lib/motion/project/template/android/launch_image", "resources"] build_dir : "build/android" features : [] files : ["./app/application.rb", "./app/game_scene.rb", "/Library/Ruby/Gems/2.0.0/gems/motion-game-1.1.5/lib/motion-game/android/main_activity.rb"] icon : nil logs_components : ["com/yourcompany/flappybird:I", "AndroidRuntime:E", "chromium:E", "dalvikvm:E", "Bundle:E"] main_activity : "MainActivity" manifest : {"xmlns:android"=>"http://schemas.android.com/apk/res/android", "package"=>#<Proc:0x007fd92aaa13f0@/Library/RubyMotion/lib/motion/project/template/android/config.rb:145 (lambda)>, "android:versionCode"=>#<Proc:0x007fd92aaa1378@/Library/RubyMotion/lib/motion/project/template/android/config.rb:147 (lambda)>, "android:versionName"=>#<Proc:0x007fd92aaa1300@/Library/RubyMotion/lib/motion/project/template/android/config.rb:148 (lambda)>} motiondir : "/Library/RubyMotion" name : "FlappyBird" ndk_path : "/Users/TLuong/.rubymotion-android/ndk" optional_features : [] package : "com.yourcompany.flappybird" permissions : [] resources_dirs : [] sdk_path : "/Users/TLuong/.rubymotion-android/sdk" services : [] specs_dir : "./spec" sub_activities : [] support_libraries : [] target_api_version : "25" theme : "@android:style/Theme.Material.Light" version_code : "1" version_name : "1.0"

Any thoughts?

Watson1978 commented 7 years ago

@friendlyuis Unfortunately, I can't reproduce this issue. Can you tell me more information to reproduce ? (ie, your android device name, etc)

friendlyuis commented 7 years ago

@Watson1978 it's a samsung s7 edge, what other information do you want?

Watson1978 commented 7 years ago

@friendlyuis Thank you for helpful information! I will try it with that device.

Watson1978 commented 7 years ago

@friendlyuis filed your issue in #58