bircastri
bircastri

Reputation: 2159

How to add widget to appcelerator application?

I have a project with alloy. (1.8 or later).

So, I want to add a widget (slider menu) at my app. Then, I have download the widget from this link

Slider menu

I have extract the folder and I have copy and paste widgets folder under my application.

So I have this situation on my project:

enter image description here

I have also added a code to my config.json:

{
    "global": {},
    "env:development": {},
    "env:test": {},
    "env:production": {},
    "os:android": {},
    "os:blackberry": {},
    "os:ios": {},
    "os:mobileweb": {},
    "os:windows": {},
    "dependencies": {
        "com.slider":"1.0"
    }
}

But if I try to start my application I have this error message:

[ERROR] :  config.json references non-existent widgets: ["com.slider"]
[ERROR] :  If you are not using these widgets, remove them from your config.json dependencies.
[ERROR] :  If you are using them, add them to your project's widget folder or as NPM package.
[ERROR] :  Alloy compiler failed

Upvotes: 0

Views: 260

Answers (1)

Prashant Saini
Prashant Saini

Reputation: 3539

There are two points you have to take care of:

  1. widgets folder must be in app folder. (you have put it in assets).

  2. In config.json com.slider must be the id of widget which is present in widget.json, or look for widget.json and copy the id from there.

The only issue you are facing is of naming conventions.

Upvotes: 3

Related Questions