Cannot get module to work in Titanium Alloy JS

2019-08-12 03:13发布

问题:

I've tried to add the TiSocial.Framework module into Titanium Alloy, and after reading several guides and questions, I still can't get it to work. What am I doing wrong?

Here are the steps I took:

  1. Copied the unzipped module files into modules/iphone/TiSocial.Framework-master
  2. Edited the TiApp.xml file with: <module platform="iphone">TiSocial.Framework-master</module>
  3. Cleaned the build tried to run the app.

But I get the following error(s):

Could not find Titanium module id=TiSocial.Framework-master version=latest platform=iphone deploy-type=development

Could not find all required Titanium Modules: id: TiSocial.Framework-master version: latest platform: iphone deploy-type: development

I can't spot where I'm going wrong, in my TiApp.xml Overview screen, I the module appears to be installed just fine (see picture):

My addition to TiApp.xml looks like this:

<modules>
    <module platform="iphone">TiSocial.Framework-master</module>
</modules>

I also tried doing the same as above but changing the name of the module, to dk.napp.social, because in the README on their GitHub account, it says to reference that in the TiApp.xml. So I tried that but it still didn't work.

回答1:

TiSocial.Framework-master is not the name of the module, also you are not supposed to unzip the entire module plus souurce code and documentation into your modules/ folder, you ONLY want the compiled module binary.

Instead do this:

  1. Inside Titanium Studio goto "Help->Install Mobile Module"
  2. Enter this url: https://github.com/viezel/TiSocial.Framework/blob/master/dist/dk.napp.social-iphone-1.7.3.zip?raw=true
  3. Choose your project, hit ok, and it should be installed now.