Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23859] App created with 6.0.0 SDK & with hyperloop references fails to build with 5.5.0 SDK with error "You cannot use the Hyperloop compiler with a version of Titanium older than 6.0.0"

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-09-12T17:10:54.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 5.5.0, hyperloop 1.2.7
ComponentsAndroid, Hyperloop, Tooling
Labelsqe-6.0.0
ReporterLokesh Choudhary
AssigneeChris Barber
Created2016-09-02T01:01:26.000+0000
Updated2016-09-14T22:00:14.000+0000

Description

Steps to reproduce:

1. Create a default app with hyperloop enabled using SDK 6.0.0. (App will get created with hyperloop module 2.0.0). 2. Now, change the SDK to 5.5.0 in the tiapp.xml, the hyperloop module to 1.2.6 & aca to 1.0.0. 3. Make sure you have references for hyperloop in the app.js e.g var View = require('android.view.View'); 4. Build the app for android device/emulator.

Actual Result:

1. The app fails to build with error:
[ERROR] :  You cannot use the Hyperloop compiler with a version of Titanium older than 6.0.0
[ERROR] :  Set the value of <sdk-version> to a newer version in tiapp.xml.
[ERROR] :  For example:
[ERROR] :  	<sdk-version>6.0.0.GA</sdk-version>
2. My modules in tiapp.xml:
        <module platform="iphone" version="1.0">com.soasta.touchtest</module>
        <module platform="android" version="1.0">com.soasta.touchtest</module>
        <module platform="iphone" version="2.0.0">hyperloop</module>
        <module platform="android" version="1.2.6">hyperloop</module>
        <module platform="iphone">com.appcelerator.aca</module>
        <module platform="android" version="1.0.0">com.appcelerator.aca</module>
        <module platform="commonjs">ti.cloud</module>

Expected Results:

1. The app should build fine with 5.5.0 SDK & hyperloop 1.2.6, even if the app is created using SDK 6.0.0.

Comments

  1. Chee Kiat Ng 2016-09-02

    ya this is a problem because the hyperloop module contains both a plugin and a module. For every new version of hyperloop module installed, the new plugin always overwrite the previous one. [~fmiao] I like to ask, I have seen for plugins like soasta, it actually maintains versions in the plugins folder. I wonder if this is applicable to the hyperloop module whereby we maintain multiple versions of the plugin as well, and use the appropriate one for every corresponding version? If this is doable, we should get this into 5.5.0.GA, hyperloop 1.2.7.
  2. Feon Sua Xin Miao 2016-09-02

    [~cng] If we can bundle hyperloop plugin like this in the zip: plugins/hyperloop/<version>/, that should prevent the plugin being overwritten when CLI extracts it.
  3. Chee Kiat Ng 2016-09-05

    [~fmiao] Then it's probably a good idea to implement this asap while we have only released 1 version of hyperloop then. Do you think you can implement this please?
  4. Feon Sua Xin Miao 2016-09-06

    [~cng], I was under the impressing that this is going to be handled when you are creating the zip file that contains both hyperloop module and plugin.
  5. Hans Knöchel 2016-09-06

    Here is what I came up with so far. Add the following lines before echo "Creating combined zip with iOS and Android":
       

    Move to version-based directory and clean-up old files

    mkdir plugins/hyperloop/1.2.7 cp -r plugins/hyperloop/!(1.2.7) plugins/hyperloop/1.2.7 rm -rf plugins/hyperloop/!(1.2.7)
    It basically creates a new directory "1.2.7", copied everything except itself into it and removes the old files from the old location afterwards. It works when used in the terminal, but using it in the shell-script and with the $VERSION variable does not seem to work. If we can figure that out, it shouldn't make any problems. [~fmiao] Can you confirm that having plugins/hyperloop/<version>/ will be detected by the CLI properly?
  6. Feon Sua Xin Miao 2016-09-07

    [~hans123], I'm not sure how will the hyperloop plugin be called during project build, as far as I'm aware, putting the plugin in a version directory will work for appc cli.
  7. Chee Kiat Ng 2016-09-07

    PR here: https://github.com/appcelerator/hyperloop.next/pull/70 One big issue with this is that it will only work if you do <plugin version="1.2.7">hyperloop<plugin> If you don't set a version, CLI will use "latest". But the problem is, CLI thinks that the content in the root folder (formally 1.2.6 since it didn't do this versioning stuff), it uses that instead. [~fmiao] Any idea what we can do about CLI's priority in finding the latest version? Let me know if it's something we can change on the CLI side, then I'll set the min sdk requirement on this 1.2.7 module to 5.5.0.
  8. Chee Kiat Ng 2016-09-07

    compiled binary for testing here: https://github.com/appcelerator/hyperloop.next/releases/tag/1.2.7-beta.2 Plus I'm having difficulty building hyperloop 2.0.0 fr Ti SDK 6.0.0 (due to android) but not urgent at this moment. will look into it later tomorrow.
  9. Hans Knöchel 2016-09-07

    [~cng], [~fmiao] Can we ensure that all new versions of Hyperloop will automatically get the version-tag in the tiapp.xml when installing Hyperloop?
  10. Chee Kiat Ng 2016-09-07

    Ok something strange happening here. I had it working earlier today but it's no longer working now. I have been testing with hyperloop-examples and I had tiapp.xml <plugin version="1.2.7">hyperloop</plugin> if you look at the trace:
        [INFO] :   Found Titanium plugin id=hyperloop version=1.2.7 
        
    That is correct but further down the trace:
        [TRACE] :  [Hyperloop] running /Users/kiat/Library/Application Support/Titanium/plugins/hyperloop/node_modules/hyperloop-metabase/bin/metabase with -i /Users/kiat/titaniumModules/hyperloop-examples/build/hyperloop/ios/metabase-7.1-iphonesimulator-bfa58c933e7311ecbbb692308ba0316a.h -o /Users/kiat/titaniumModules/hyperloop-examples/build/hyperloop/ios/metabase-7.1-iphonesimulator-bfa58c933e7311ecbbb692308ba0316a.json -sim-sdk-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk -min-ios-ver 7.1 -pretty
        
    it should be running /Users/kiat/Library/Application Support/Titanium/plugins/hyperloop/1.2.7/node_modules/hyperloop-metabase/bin/metabase instead of /Users/kiat/Library/Application Support/Titanium/plugins/hyperloop/node_modules/hyperloop-metabase/bin/metabase Not sure what went wrong. *Important thing to note*: This is tested with 1.2.6 installed prior. That means, there's already 1.2.6 plugin in the root folder (without a version folder). So this will happen to people who installed 1.2.6 before installing 1.2.7.
  11. Feon Sua Xin Miao 2016-09-07

    https://github.com/appcelerator/node-appc/blob/master/lib/tiplugin.js#L278-L290, looks like if there are plugin files in the root folder, plugin in detection will not loop through the versions. I think we should also re-package hyperloop@1.2.6 tarballs to include the version folder, and also put a note to inform developers that they should remove the hyperloop plugins folder so the next time hyperloop module installation kicks in, the plugin will be in the version folder.
  12. Chee Kiat Ng 2016-09-08

    Master PR here for hyperloop versioning: https://github.com/appcelerator/hyperloop.next/pull/71 [~jvennemann]
  13. Jan Vennemann 2016-09-08

    Changes to the build script approved and merged for both 1.2.x and master branch.
  14. Chris Barber 2016-09-08

    TiSDK master PR: https://github.com/appcelerator/titanium_mobile/pull/8327 TiSDK 6_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/8328 TiSDK 5_5_X PR: https://github.com/appcelerator/titanium_mobile/pull/8329
  15. Chee Kiat Ng 2016-09-09

    How to test for 5.5.0

    Use the latest environment on preproduction for 5_5_X, and test the following scenarios whereby someone previously on 5.4.0.GA just updated to 5.5.0. - *Create a brand new app after upgrade*

    appc new --classic

    appc run -p ios -I 10.0

    App should build and run normally. Also to check in Library/Application Support/Titanium/plugins/hyperloop if there's both 1.2.6 and 1.2.7 folders, with no other files in the root.

    - *Changing the sdk in tiapp.xml and running a pre-existing hyperloop-enabled app*

    Using hyperloop-examples, in tiapp.xml, change the sdk-version to the version that contains this fix, and make sure that plugin and module of hyperloop has no specific version number assigned.

    appc run -p ios -I 10.0

    App should build and run normally. Also to check in Library/Application Support/Titanium/plugins/hyperloop if there's both 1.2.6 and 1.2.7 folders, with no other files in the root.

    Something to note for multiple Xcode installations and Hyperloop

    If you have multiple Xcode installations, and you use the -I flag in appc cli, make sure that the Active Xcode is consistent with that flag. - sudo xcode-select --switch /Applications/Xcode8.app and appc run -p ios -I 10.0 - sudo xcode-select --switch /Applications/Xcode731.app and appc run -p ios -I 9.3 will work well with Hyperloop. And if you switch between Xcodes, make sure to clean the project.
  16. Chee Kiat Ng 2016-09-09

    CR and FT passed. PRs merged. However, to test this properly, this new ticket has to be addressed: CLI-1101
  17. Lokesh Choudhary 2016-09-14

    Verified the fix. We get version folders for both hyperloop plugin & module. FYI, when you have an app created with 6.0.0 SDK with hyperloop enabled & want to build it with 5.5.0.GA SDK with 1.2.7 hyperloop module you got to manually select the 1.2.7 plugin in the tiapp.xml.
         <plugins>
                <plugin version="1.2.7">hyperloop</plugin>
        </plugins>
        
    Closing. Environment: Appc Studio : 4.8.0.201609061702 Ti SDK : 6.0.0.v20160913184210 , 5.5.0.GA Ti CLI : 5.0.9 Alloy : 1.9.1 MAC El Capitan : 10.11.6 Appc NPM : 4.2.8-6 Appc CLI : 6.0.0-38 Node: 4.4.4 Nexus 6 - Android 6.0.1

JSON Source