封装安卓UTS库时,遇到如下问题:
Error: targetMethod error::java.lang.NoClassDefFoundError: Failed resolution of: Lcom/ccb/ccbnetpay/platform/CcbPayPlatform$Builder;
三方库如下:
import Builder from '../../../../com/ccb/ccbnetpay/platform/CcbPayPlatform/Builder';
import Platform from '../../../../com/ccb/ccbnetpay/platform/Platform';
export default class CcbPayPlatform extends Platform {
public static class: Class<CcbPayPlatform>;
static Builder: typeof Builder;
public constructor(param0: Builder);
public startAppOrH5(): void;
}
调用如下:
let builder = new CcbPayPlatform.Builder()
builder.setActivity(UTSAndroid.getUniActivity()! as Activity)
builder.setParams(response)
builder.setPayStyle(Platform.PayStyle.APP_OR_H5_PAY)
let ccbPayPlatform = builder.build()
ccbPayPlatform.pay()
整体应该问题出在,new CcbPayPlatform.Builder() 这行,感觉像是找不到内部类,但是要如何修改内,因为这个Builder类内部有很多个,只是包名不一样,直接重命名也不行,构造函数不对。该如何修复
1 个回复
DCloud_Android_zl
import不对,可以参考示例:https://gitcode.net/dcloud/hello-uts/-/tree/dev/uni_modules/uts-tencentgeolocation/utssdk/app-android