I tried to build extensions by first adding two simple methods "Muls" & "dd2".
These two methods could be correctly called from AI2. I then tried to add a third method "fvalue".
I rebuilt the extension and the extension was imported into a new project. I still could access the two
simple methods. I could see the method "fvalue" in the block screen. Bit when I tried to run my app
through the emulator, I got the following error
"Runtime Error
invoke: no method named `fvalue' in class org.comman.CalcTest<br/><i>Note:</i> You will not see another error reported for 5 seconds."
Could anyone advise me where the problem is, any suggestion appreciated.
-------------This is my method definition---------------------------
@SimpleFunction(description = "test multi")
public double Mul2(String x, String y) {
return Double.parseDouble(x)*Double.parseDouble(y);
}
@SimpleFunction(description = "test div")
public double dd2(String x, String y) {
return Double.parseDouble(x)/Double.parseDouble(y);
}
@SimpleFunction(description = "test FV")
public double fvalue(String r_s, String nper_s, String pmt_s, String pv_s, String type_s) {
double r = Double.parseDouble(r_s) ;
int nper = Integer.parseInt(nper_s);
double pmt = Double.parseDouble(pmt_s) ;
double pv = Double.parseDouble(pv_s) ;
int type = Integer.parseInt(type_s);
double fvalue = -(pv * Math.pow(1 + r, nper) + pmt * (1+r*type) * (Math.pow(1 + r, nper) - 1) / r);
return fvalue;
}