http://ask.dcloud.net.cn/article/243
我是参考这个帖子去做的,整体没问题的离线打包的app可以正常运行。
var mainActivity = plus.android.runtimeMainActivity();
var DevInit = plus.android.importClass("com.dlnetwork.DevInit");
var d = new DevInit();
mui.toast(mainActivity);
d.initGoogleContext(mainActivity,"TEST_DIANJOY_APP_ID","test"); //主要是这行报错,注释掉后就可以调用新的Activity,但无法正确打开。
d.showOffers(mainActivity);
ADT报错内容如下:
06-23 17:24:03.197 30234-30234/io.dcloud.HBuilder.Hello E/InvProxy: NativeObject.execMethod initGoogleContext method ; params=[{"type":"object","value":"Invocation1397541140"},{"type":"string","value":"TEST_DIANJOY_APP_ID"},{"type":"string","value":"test"}]java.lang.reflect.InvocationTargetException
06-23 17:24:04.725 30234-30234/io.dcloud.HBuilder.Hello E/InvProxy: NativeObject.execMethod initGoogleContext method ; params=[{"type":"object","value":"Invocation1397541140"},{"type":"string","value":"TEST_DIANJOY_APP_ID"},{"type":"string","value":"test"}]java.lang.reflect.InvocationTargetException
附件中的是我引用的积分墙类库,需要放到app/libs目录中,同时添加Build Path。