rhomobile / rhoelements-issues

Issues area for RhoElements
0 stars 0 forks source link

Can't build for iOS with app_type: rhoelements #69

Open pascalw opened 10 years ago

pascalw commented 10 years ago

Hello,

I'm upgrading a RhoMobile 2 application to RhoMobile 4. If I try to build for iOS from XCode I get the following exception:

...

ext - barcode
exception: cannot load such file -- barcode
********* WARNING *****************************************************************************************************
The following extensions do not have JavaScript API: 
digest
digest-sha1
Use RMS 4.0 extensions to provide JavaScript API
***********************************************************************************************************************
********* WARNING ************************************************************************
 The following features are only available in RhoElements v2 and above:
- Barcode extension
- Indicators extension
- HardwareKeys extension
- Audio Capture
 For more information go to http://www.motorolasolutions.com/rhoelements 
******************************************

I'm not using the barcode api though.

My build.yml looks like this (abbreviated):


---
sdkversion: 4.0.0
iphone:
  configuration: Release
  sdk: iphonesimulator6.1
  capabilities:
    - non_motorola_device
    - native_browser
    - camera
android:
  android_title: 0
  version: 2.1
  capabilities:
    - non_motorola_device
    - native_browser
    - camera
    - hardware_acceleration
extensions:
  - coreapi
  - mspec
  - fileutils
  - json
  - rholang
  - digest
  - "digest-sha1"
motorola_license: ...
app_type: rhoelements
capabilities:
  - bluetooth
  - gps
  - vibrate

Removing the app_tye: rhoelements line allows the app to build, but I do need some of the rhoelements APIs. Any ideas what's causing this and how I can fix it?

genywind commented 10 years ago

try to remove capabilities:

if it will not help, run gem list and post output pls

pascalw commented 10 years ago

Hi @genywind, tried but no dice.

$ gem list
activesupport (3.2.13, 2.3.18)
ast (1.1.0)
builder (3.2.0)
bundler (1.2.1)
capybara (2.0.2)
capybara-webkit (0.14.2)
childprocess (0.3.9)
cucumber (1.2.3)
diff-lcs (1.2.4, 1.2.1)
extlib (0.9.16)
factory_girl (4.2.0)
ffi (1.4.0)
foreman (0.62.0)
gherkin (2.11.6)
highline (1.6.19)
i18n (0.6.1)
iconv (1.0.3)
json (1.7.7)
json_spec (1.1.1)
macaddr (1.6.1)
mime-types (1.21)
multi_json (1.6.1)
nokogiri (1.5.6)
parser (2.0.0)
powerpack (0.0.9)
rack (1.5.2)
rack-test (0.6.2)
rainbow (1.1.4)
rake (0.9.2.2)
rb-fsevent (0.9.3)
rhodes (4.0.0)
rhoelements (4.0.0)
rspec (2.14.1, 2.13.0)
rspec-core (2.14.5, 2.13.1)
rspec-expectations (2.14.1, 2.13.0)
rspec-mocks (2.14.3, 2.13.0)
rubocop (0.14.1)
rubygems-bundler (1.1.0)
rubyzip (0.9.9)
rvm (1.11.3.5)
sass (3.2.7)
selenium-webdriver (2.31.0)
slop (3.4.6)
sqlite3 (1.3.7)
systemu (2.5.2)
templater (1.0.0)
thor (0.18.0)
uuid (2.3.7)
websocket (1.0.7)
xpath (1.0.0)
genywind commented 10 years ago

check that you don't have RHO_HOME environment variable and post all output pls

pascalw commented 10 years ago

@genywind see email.

genywind commented 10 years ago

http://docs.rhomobile.com/en/4.0.0/guide/build_ios#build-an-ios-app-with-xcode

rake build:iphone:setup_xcode_project

pascalw commented 10 years ago

@genywind one step closer but not quite there yet. Now it stops at:

** BUILD SUCCEEDED **
cp ./build/Debug-iphonesimulator/libDsha1.a /Users/Pascal/.rvm/gems/ruby-1.9.3-p194@app-rho4/gems/rhodes-4.0.0/platform/iphone/build/rhorunner.build/Debug-iphonesimulator/rhorunner.build/libdigest-sha1.a
** Execute default
cp /Users/Pascal/.rvm/gems/ruby-1.9.3-p194@app-rho4/gems/rhoelements-4.0.0/libs/barcode/ext/iphone/libBarcode.a /Users/Pascal/.rvm/gems/ruby-1.9.3-p194@app-rho4/gems/rhodes-4.0.0/platform/iphone/build/rhorunner.build/Release-iphonesimulator/rhorunner.build/libBarcode.a
rake aborted!
No such file or directory - /Users/Pascal/.rvm/gems/ruby-1.9.3-p194@app-rho4/gems/rhodes-4.0.0/platform/iphone/build/rhorunner.build/Release-iphonesimulator/rhorunner.build/libBarcode.a

See full output in mail.

genywind commented 10 years ago

try to run rake clean:iPhone delete bin folder inside application rake build:iphone:setup_xcode_project

pascalw commented 10 years ago

It get's worse. After that I get this:

CMD: "/Users/Pascal/.rvm/gems/ruby-1.9.3-p194@<snip>/gems/rhodes-4.0.0/bin/rhogen" api "/Users/Pascal/.rvm/gems/ruby-1.9.3-p194@<snip>/gems/rhodes-4.0.0/lib/commonAPI/coreapi/ext/Application.xml"
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- templater (LoadError)

If I then build from the command line first with rake run:iphone and then build in Xcode again it get's a bit further but then after a while bails out with

ld: file not found: /Users/Pascal/.rvm/gems/ruby-1.9.3-p194@<snip>/gems/rhodes-4.0.0/platform/iphone/build/rhorunner.build/Debug-iphonesimulator/rhorunner.build/libBarcode.a
dmitrys commented 10 years ago

Check two moments:

  1. when you build in XCode for device, build.yml sdk in iphone section must be equal (device or simulator)
  2. check your ~/.profile for correct RVM initialization
pascalw commented 10 years ago

@dmitrys can you elaborate on point 1?

Regarding point 2; rvm initialization is fine. Building in xcode worked fine on Rhodes 3. Also building with app_type: rhoelements also works fine.

genywind commented 10 years ago

point 1: in build.yml you have iphone section: iphone: configuration: Release sdk: iphonesimulator7.0 provisionprofile: codesignidentity: entitlements: BundleIdentifier: com.opened.studentaap BundleURLScheme: studentaapopened

So check that sdk is correct. to build for device: sdk: iphone7.0

pascalw commented 10 years ago

@genywind that doesn't work either. Whatever I do, building in Xcode with app_type: rhoelements just seems broken. With the same config, device:iphone:production for example works from the command line.

pascalw commented 10 years ago

Any news gents?

pfmaggi commented 10 years ago

If I understand correctly, Pascal is using rhodes gem v4.0.0.0, released in September 2013. Looking at the commits it seems to me that some stuffs as been added since then to fix some of the iOS build issues. @genywind @dmitrys can you confirm if, moving to a newer rhodes gem (or cloning v4.0 branch) is the way to go to build for iOS.

genywind commented 10 years ago

Hello,

2 questions:

  1. What API do you need from rhoelements?
  2. What did you try to build under Xcode: debug for iPhone Simulator ?

Regards, Evgeny.

vmusulainen commented 10 years ago

@pascalw Try to set "build configuration" to release for your xCode project. You can find this option here: "Product" -> "Edit scheme" -> "Run your app name" -> "Info" tab -> "Build configuration" option.