vilicvane / cordova-plugin-wechat

Cordova 微信分享插件
172 stars 53 forks source link

添加 Android 时一直出现 Variable(s) APP_ID missing #1

Closed pantao closed 9 years ago

pantao commented 9 years ago

Ionic + AngularJS + Cordova

PS D:\workspace\ionic\WechatApp> cordova platform add android
npm http GET https://registry.npmjs.org/cordova-android/3.6.4
npm http 304 https://registry.npmjs.org/cordova-android/3.6.4
Creating android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.ionicframework.wechatapp720428
        Name: WechatApp
        Android target: android-19
Copying template files...
Project successfully created.
Running command: "C:\Program Files\nodejs\node.exe" D:\workspace\ionic\WechatApp\hooks\after_prepare\010_add_platform_cl
ass.js D:\workspace\ionic\WechatApp
add to body class: platform-android
Installing "com.ionic.keyboard" for android
Installing "com.wordsbaking.cordova.wechat" for android
Failed to install 'com.wordsbaking.cordova.wechat':Error: Variable(s) missing: APP_ID
    at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:304:23
    at _fulfilled (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
    at Promise.promise.promiseDispatch (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749
:13)
    at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:557:44
    at flush (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
    at process._tickCallback (node.js:419:13)
Error: Variable(s) missing: APP_ID
    at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:304:23
    at _fulfilled (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
    at Promise.promise.promiseDispatch (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749
:13)
    at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:557:44
    at flush (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
    at process._tickCallback (node.js:419:13)
vilicvane commented 9 years ago

你好,请先卸载插件再重装,记得带上变量,具体参照安装说明。

Sent from my Lumia 930


From: 潘韬mailto:notifications@github.com Sent: ‎1/‎6/‎2015 11:36 PM To: vilic/cordova-plugin-wechatmailto:cordova-plugin-wechat@noreply.github.com Subject: [cordova-plugin-wechat] 添加 Android 时一直出现 Variable(s) APP_ID missing (#1)

Ionic + AngularJS + Cordova

    PS D:\workspace\ionic\WechatApp> cordova platform add android
    npm http GET https://registry.npmjs.org/cordova-android/3.6.4
    npm http 304 https://registry.npmjs.org/cordova-android/3.6.4
    Creating android project...
    Creating Cordova project for the Android platform:
                    Path: platforms\android
                    Package: com.ionicframework.wechatapp720428
                    Name: WechatApp
                    Android target: android-19
    Copying template files...
    Project successfully created.
    Running command: "C:\Program Files\nodejs\node.exe" D:\workspace\ionic\WechatApp\hooks\after_prepare\010_add_platform_cl
    ass.js D:\workspace\ionic\WechatApp
    add to body class: platform-android
    Installing "com.ionic.keyboard" for android
    Installing "com.wordsbaking.cordova.wechat" for android
    Failed to install 'com.wordsbaking.cordova.wechat':Error: Variable(s) missing: APP_ID
            at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:304:23
            at _fulfilled (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
            at self.promiseDispatch.done (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
            at Promise.promise.promiseDispatch (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749
    :13)
            at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:557:44
            at flush (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
            at process._tickCallback (node.js:419:13)
    Error: Variable(s) missing: APP_ID
            at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:304:23
            at _fulfilled (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
            at self.promiseDispatch.done (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
            at Promise.promise.promiseDispatch (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749
    :13)
            at C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:557:44
            at flush (C:\Users\pantao\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
            at process._tickCallback (node.js:419:13)

Reply to this email directly or view it on GitHub: https://github.com/vilic/cordova-plugin-wechat/issues/1

pantao commented 9 years ago

我的安装的时候就是带参数的,也是没有用的……

vilicvane commented 9 years ago

咦, 不该呀. 可能 Cordova 的变量是分平台的 (见 plugins 目录下以平台命名的 JSON 文件), 可以尝试先 remove 掉插件, 添加平台后再次安装.

pantao commented 9 years ago

我按你的方法,先添加 Android 然后再添加 Plugin,但是还是不能分享……下面是日志:

01-08 14:10:21.583: I/ThermalEngine(392): Sensor:batt_temp:248 mC
01-08 14:10:21.643: D/StatusBar.NetworkController(1416): changing data overlay icon id to 2130837786
01-08 14:10:21.753: D/wpa_supplicant(1486): RX ctrl_iface - hexdump(len=11): 53 49 47 4e 41 4c 5f 50 4f 4c 4c
01-08 14:10:21.753: D/wpa_supplicant(1486): wlan0: Control interface command 'SIGNAL_POLL'
01-08 14:10:21.773: D/wpa_supplicant(1486): nl80211: survey data missing!
01-08 14:10:21.833: D/WhetstoneService(1670): deal background too Frequently, ingore
01-08 14:10:22.063: D/CordovaActivity(22072): onMessage(spinner,stop)
01-08 14:10:22.583: I/ThermalEngine(392): Sensor:batt_temp:248 mC
01-08 14:10:22.653: D/StatusBar.NetworkController(1416): changing data overlay icon id to 0
01-08 14:10:23.583: I/ThermalEngine(392): Sensor:batt_temp:249 mC
01-08 14:10:23.653: D/StatusBar.NetworkController(1416): changing data overlay icon id to 2130837785
01-08 14:10:23.753: D/MicroMsg.SDK.WXApiImplV10(22072): check signature:308202eb30820254a00302010202044d36f7a4300d06092a864886f70d01010505003081b9310b300906035504061302383631123010060355040813094775616e67646f6e673111300f060355040713085368656e7a68656e31353033060355040a132c54656e63656e7420546563686e6f6c6f6779285368656e7a68656e2920436f6d70616e79204c696d69746564313a3038060355040b133154656e63656e74204775616e677a686f7520526573656172636820616e6420446576656c6f706d656e742043656e7465723110300e0603550403130754656e63656e74301e170d3131303131393134333933325a170d3431303131313134333933325a3081b9310b300906035504061302383631123010060355040813094775616e67646f6e673111300f060355040713085368656e7a68656e31353033060355040a132c54656e63656e7420546563686e6f6c6f6779285368656e7a68656e2920436f6d70616e79204c696d69746564313a3038060355040b133154656e63656e74204775616e677a686f7520526573656172636820616e6420446576656c6f706d656e742043656e7465723110300e0603550403130754656e63656e7430819f300d06092a864886f70d010101050003818d0030818902818100c05f34b231b083fb1323670bfbe7bdab40c0c0a6efc87ef2072a1ff0d60cc67c8edb0d0847f210bea6cbfaa241be70c86daf56be08b723c859e52428a064555d80db448cdcacc1aea2501eba06f8bad12a4fa49d85cacd7abeb68945a5cb5e061629b52e3254c373550ee4e40cb7c8ae6f7a8151ccd8df582d446f39ae0c5e930203010001300d06092a864886f70d0101050500038181009c8d9d7f2f908c42081b4c764c377109a8b2c70582422125ce545842d5f520aea69550b6bd8bfd94e987b75a3077eb04ad341f481aac266e89d3864456e69fba13df018acdc168b9a19dfd7ad9d9cc6f6ace57c746515f71234df3a053e33ba93ece5cd0fc15f3e389a3f365588a9fcb439e069d3629cd7732a13fff7b891499
01-08 14:10:23.753: D/MicroMsg.SDK.WXApiImplV10(22072): pass
01-08 14:10:23.753: D/MicroMsg.SDK.WXApiImplV10(22072): register app com.loaferback.jixiebao
01-08 14:10:23.773: D/MicroMsg.SDK.MMessage(22072): send mm message, intent=Intent { act=com.tencent.mm.plugin.openapi.Intent.ACTION_HANDLE_APP_REGISTER (has extras) }, perm=com.tencent.mm.permission.MM_MESSAGE
01-08 14:10:23.773: D/MicroMsg.SDK.WXApiImplV10(22072): check signature:308202eb30820254a00302010202044d36f7a4300d06092a864886f70d01010505003081b9310b300906035504061302383631123010060355040813094775616e67646f6e673111300f060355040713085368656e7a68656e31353033060355040a132c54656e63656e7420546563686e6f6c6f6779285368656e7a68656e2920436f6d70616e79204c696d69746564313a3038060355040b133154656e63656e74204775616e677a686f7520526573656172636820616e6420446576656c6f706d656e742043656e7465723110300e0603550403130754656e63656e74301e170d3131303131393134333933325a170d3431303131313134333933325a3081b9310b300906035504061302383631123010060355040813094775616e67646f6e673111300f060355040713085368656e7a68656e31353033060355040a132c54656e63656e7420546563686e6f6c6f6779285368656e7a68656e2920436f6d70616e79204c696d69746564313a3038060355040b133154656e63656e74204775616e677a686f7520526573656172636820616e6420446576656c6f706d656e742043656e7465723110300e0603550403130754656e63656e7430819f300d06092a864886f70d010101050003818d0030818902818100c05f34b231b083fb1323670bfbe7bdab40c0c0a6efc87ef2072a1ff0d60cc67c8edb0d0847f210bea6cbfaa241be70c86daf56be08b723c859e52428a064555d80db448cdcacc1aea2501eba06f8bad12a4fa49d85cacd7abeb68945a5cb5e061629b52e3254c373550ee4e40cb7c8ae6f7a8151ccd8df582d446f39ae0c5e930203010001300d06092a864886f70d0101050500038181009c8d9d7f2f908c42081b4c764c377109a8b2c70582422125ce545842d5f520aea69550b6bd8bfd94e987b75a3077eb04ad341f481aac266e89d3864456e69fba13df018acdc168b9a19dfd7ad9d9cc6f6ace57c746515f71234df3a053e33ba93ece5cd0fc15f3e389a3f365588a9fcb439e069d3629cd7732a13fff7b891499
01-08 14:10:23.773: D/MicroMsg.SDK.WXApiImplV10(22072): pass
01-08 14:10:23.783: D/MicroMsg.SDK.WXApiImplV10(22072): check signature:308202eb30820254a00302010202044d36f7a4300d06092a864886f70d01010505003081b9310b300906035504061302383631123010060355040813094775616e67646f6e673111300f060355040713085368656e7a68656e31353033060355040a132c54656e63656e7420546563686e6f6c6f6779285368656e7a68656e2920436f6d70616e79204c696d69746564313a3038060355040b133154656e63656e74204775616e677a686f7520526573656172636820616e6420446576656c6f706d656e742043656e7465723110300e0603550403130754656e63656e74301e170d3131303131393134333933325a170d3431303131313134333933325a3081b9310b300906035504061302383631123010060355040813094775616e67646f6e673111300f060355040713085368656e7a68656e31353033060355040a132c54656e63656e7420546563686e6f6c6f6779285368656e7a68656e2920436f6d70616e79204c696d69746564313a3038060355040b133154656e63656e74204775616e677a686f7520526573656172636820616e6420446576656c6f706d656e742043656e7465723110300e0603550403130754656e63656e7430819f300d06092a864886f70d010101050003818d0030818902818100c05f34b231b083fb1323670bfbe7bdab40c0c0a6efc87ef2072a1ff0d60cc67c8edb0d0847f210bea6cbfaa241be70c86daf56be08b723c859e52428a064555d80db448cdcacc1aea2501eba06f8bad12a4fa49d85cacd7abeb68945a5cb5e061629b52e3254c373550ee4e40cb7c8ae6f7a8151ccd8df582d446f39ae0c5e930203010001300d06092a864886f70d0101050500038181009c8d9d7f2f908c42081b4c764c377109a8b2c70582422125ce545842d5f520aea69550b6bd8bfd94e987b75a3077eb04ad341f481aac266e89d3864456e69fba13df018acdc168b9a19dfd7ad9d9cc6f6ace57c746515f71234df3a053e33ba93ece5cd0fc15f3e389a3f365588a9fcb439e069d3629cd7732a13fff7b891499
01-08 14:10:23.783: D/MicroMsg.SDK.WXApiImplV10(22072): pass
01-08 14:10:23.783: I/Timeline(22072): Timeline: Activity_launch_request id:com.tencent.mm time:154872230
01-08 14:10:23.783: I/ActivityManager(1170): START u0 {flg=0x18000000 cmp=com.tencent.mm/.plugin.base.stub.WXEntryActivity (has extras)} from pid 22072
01-08 14:10:23.863: D/dalvikvm(1170): GC_FOR_ALLOC freed 1978K, 26% free 39440K/52828K, paused 71ms, total 71ms
01-08 14:10:23.923: D/dalvikvm(1170): GC_FOR_ALLOC freed 865K, 23% free 41011K/52828K, paused 53ms, total 53ms
01-08 14:10:23.923: D/CordovaActivity(22072): Paused the application!
01-08 14:10:23.923: D/CordovaWebView(22072): Handle the pause
01-08 14:10:23.933: D/MicroMsg.SDK.MMessageAct(22072): send mm message, intent=Intent { flg=0x18000000 cmp=com.tencent.mm/.plugin.base.stub.WXEntryActivity (has extras) }
01-08 14:10:23.933: W/PluginManager(22072): THREAD WARNING: exec() call to WeChat.share blocked the main thread for 153ms. Plugin should use CordovaInterface.getThreadPool().
01-08 14:10:23.963: I/libmc(1670): task pid 12718 have been add to group sys_app_fg.
01-08 14:10:23.983: I/libmc(1670): task pid 20753 have been add to group sys_app_fg.
01-08 14:10:23.983: I/libmc(1670): [sys_app_fg]cgroup_add_tasks max single write time: 27ms
01-08 14:10:23.983: I/libmc(1670): [sys_app_fg]cgroup_add_tasks total time consume: 53ms
01-08 14:10:24.013: I/libmc(1670): task pid 22072 have been add to group sys_app_fg.
01-08 14:10:24.013: I/libmc(1670): [sys_app_fg]cgroup_add_tasks max single write time: 1ms
01-08 14:10:24.013: I/libmc(1670): [sys_app_fg]cgroup_add_tasks total time consume: 1ms
01-08 14:10:24.013: D/CordovaActivity(22072): Resuming the App
01-08 14:10:24.013: W/InputMethodManagerService(1170): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@42db6180 attribute=null, token = android.os.BinderProxy@4232c740
01-08 14:10:24.033: I/XiaomiFirewall(2154): firewall pkgName:com.tencent.mm, result:0
01-08 14:10:24.033: I/Timeline(22072): Timeline: Activity_idle id: android.os.BinderProxy@42236da8 time:154872482
01-08 14:10:24.583: I/ThermalEngine(392): Sensor:batt_temp:249 mC
01-08 14:10:24.783: D/wpa_supplicant(1486): RX ctrl_iface - hexdump(len=11): 53 49 47 4e 41 4c 5f 50 4f 4c 4c
01-08 14:10:24.783: D/wpa_supplicant(1486): wlan0: Control interface command 'SIGNAL_POLL'
01-08 14:10:24.783: D/wpa_supplicant(1486): nl80211: survey data missing!
01-08 14:10:24.873: D/StatusBar.NetworkController(1416): onSignalStrengthsChanged signalStrength=SignalStrength: 99 0 -80 -115 -75 -55 2 99 2147483647 2147483647 2147483647 2147483647 2147483647 cdma level=2
01-08 14:10:24.873: D/StatusBar.NetworkController(1416): updateTelephonySignalStrength: mSignalStrength == 99(GSM) 8(CDMA)
01-08 14:10:25.583: I/ThermalEngine(392): Sensor:batt_temp:249 mC
01-08 14:10:25.663: W/IdleConnectionHandler(15461): Removing a connection that never existed!
01-08 14:10:26.593: I/ThermalEngine(392): Sensor:batt_temp:250 mC
01-08 14:10:27.003: W/ManagedEGLContext(12473): doTerminate failed: EGL count is 2 but managed count is 1
01-08 14:10:27.013: D/WhetstoneService(1670): deal background too Frequently, ingore
01-08 14:10:27.043: D/dalvikvm(12473): GC_EXPLICIT freed 4K, 18% free 21457K/25952K, paused 3ms+5ms, total 39ms
01-08 14:10:27.053: D/dalvikvm(1915): GC_EXPLICIT freed 9K, 53% free 20814K/43980K, paused 4ms+7ms, total 54ms
01-08 14:10:27.093: D/dalvikvm(23481): GC_EXPLICIT freed <1K, 42% free 11290K/19228K, paused 55ms+1ms, total 94ms
01-08 14:10:27.593: I/ThermalEngine(392): Sensor:batt_temp:250 mC
01-08 14:10:27.663: D/StatusBar.NetworkController(1416): changing data overlay icon id to 0
01-08 14:10:27.783: D/wpa_supplicant(1486): RX ctrl_iface - hexdump(len=11): 53 49 47 4e 41 4c 5f 50 4f 4c 4c
01-08 14:10:27.783: D/wpa_supplicant(1486): wlan0: Control interface command 'SIGNAL_POLL'
01-08 14:10:27.803: D/wpa_supplicant(1486): nl80211: survey data missing!
01-08 14:10:28.593: I/ThermalEngine(392): Sensor:batt_temp:250 mC
01-08 14:10:29.013: D/Ulp_jni(1170): Location CB invoked
vilicvane commented 9 years ago

嘿嘿, 问题解决一个是一个嘛. 安卓的你有用 release 的 keystore 签名吗? 另外这个签名应该和你提交审核的签名一致, 否则无法分享哟 (而且是 silent fail, 特别坑)~

pantao commented 9 years ago

iOS 上面完美解决,可是这Android,坑大发了

vilicvane commented 9 years ago

嗯, iOS 都不要求 app id 审核通过, 立马可以用, 就 android 的比较麻烦, 一方面要等审核通过, 另一方面还要签名一致.

pantao commented 9 years ago

我想问一下下签名是不是就是指我发布应用的时候,那个 Keystore 的密码?

cainiaodan commented 9 years ago

给你发了一个邮件到i@vilic.info。方便看下以及加下QQ不?

vilicvane commented 9 years ago

@pantao 不是密码, 有个工具可以获得这个签名, 你看看微信 SDK 的 Android 接入指南, 另外这个签名也应该提交审核. @cainiaodan 可惜是个汉子,,, 我也有自己的事情哟, 分享出来只是为了大家方便. 你的问题估计和他的一样, 注意下签名.

vilicvane commented 9 years ago

哦不是接入指南, 貌似是开放平台资源页面的常见问题, 然后可以以 "android 微信 sdk 签名" 为关键字搜搜.

cainiaodan commented 9 years ago

早说是个汉子的原因嘛。看来还是换回我女人身的更合适。么么哒。

vilicvane commented 9 years ago

哟嚯嚯~

cainiaodan commented 9 years ago

亲,百忙之中可以瞧下邮件不?实在没办法了。哎。已经为这事折腾八天了。现在苹果已经搞定,安卓就是搞不定。

vilicvane commented 9 years ago

哎, 干脆我写个 check list 给你们...

VILIC VANEDuring the transition from a computer geek to a physics nerd...Website - Facebook - Twitter

Date: Thu, 8 Jan 2015 03:41:42 -0800 From: notifications@github.com To: cordova-plugin-wechat@noreply.github.com CC: i@vilic.info Subject: Re: [cordova-plugin-wechat] 添加 Android 时一直出现 Variable(s) APP_ID missing (#1)

亲,百忙之中可以瞧下邮件不?实在没办法了。哎。已经为这事折腾八天了。现在苹果已经搞定,安卓就是搞不定。

— Reply to this email directly or view it on GitHub.

vilicvane commented 9 years ago

https://github.com/vilic/cordova-plugin-wechat/wiki/Android-%E5%BE%AE%E4%BF%A1-SDK-%E7%AD%BE%E5%90%8D%E9%97%AE%E9%A2%98