0
votes

I am trying to build my own Titanium module. For this I have created a UncloudedModule.java file:

@Kroll.module(name="Unclouded", id="vub.ac.be.unclouded")
public class UncloudedModule extends KrollModule {
    // Standard Debugging variables
    private static final String TAG = "UncloudedModule";

    public UncloudedModule() {
        super();
    }

    public UncloudedModule(TiContext context) {
        super(context);
    }

    @Kroll.onAppCreate
    public static void onAppCreate(TiApplication app) {
    }
}

and an UncloudedProxy.java file:

@Kroll.proxy(creatableInModule = UncloudedModule.class)
public class UncloudedProxy extends KrollProxy {
    private final Unclouded unclouded;



    // Constructor
    public UncloudedProxy() {
        super();
        unclouded = Unclouded.getInstance();
    }

    @Kroll.method
    public Network goOnline() {
        return unclouded.goOnline();
    }

    @Kroll.method
    public void goOffline() {
        unclouded.goOffline();
    }
}

As can be read in the Android Module development guide, the creatableInModule annotation should automaticcaly add the > createUnclouded > method to the UncloudedModule. This however does not happen, since the .createUnclouded method is not found, while other method (defined in the UncloudedModule) can be used. My setup:

Some additional information:

  • Application type: mobile
  • Titanium SDK:3.1.3 (09/18/13 12:00 222f4d1)
  • Platform & version: Android 4.2.2
  • Host Operating System: OSX 10.8.4
  • Titanium Studio: Titanium Command-Line Interface, CLI version 3.2.1, Titanium SDK version 3.2.1.GA
1
I also have tried to copy the ExampleProxy as another proxy, but also this proxy is not available in Javascript. So I assume the problem doesn't lie with the proxy itself, but in the configuration or compile process.JasperTack

1 Answers

3
votes

For those having the same problem, this post helped me to solve it : http://developer.appcelerator.com/question/153993/how-to-create-a-proxy#answer-264746

Need to remove the files in the bin, libs, and build folder. Then do a clean, in Eclipse. After all of that it tends to build.

In my case, just removing build/* and libs/* then clean did the trick !