Closed weenta closed 6 years ago
Did you install the module correctly? Please check the .weex_plugin.json
file in your Android project (/platforms/android/.weex_plugin.json
).
btw, you should use weex run android
to launch the app after adding new weex plugin.
actually, i did use weex run android
and the modules seems installed correctly(except the last module):
/platforms/android/.weex_plugin.json
[
{
"type": "maven",
"groupId": "com.instapp.nat",
"name": "weex-plugin-camera",
"version": "1.0.0-alpha",
"dependency": "com.instapp.nat:weex-plugin-camera:1.0.0-alpha"
},
{
"type": "maven",
"groupId": "com.instapp.nat",
"name": "weex-plugin-communication",
"version": "1.0.0-alpha",
"dependency": "com.instapp.nat:weex-plugin-communication:1.0.0-alpha"
},
{
"type": "maven",
"groupId": "com.instapp.nat",
"name": "weex-plugin-device-info",
"version": "1.0.0-alpha",
"dependency": "com.instapp.nat:weex-plugin-device-info:1.0.0-alpha"
},
{
"type": "maven",
"groupId": "com.instapp.nat",
"name": "weex-plugin-device-vibration",
"version": "1.0.0-alpha.1",
"dependency": "com.instapp.nat:weex-plugin-device-vibration:1.0.0-alpha.1"
},
{
"type": "maven",
"groupId": "com.instapp.nat",
"name": "weex-plugin-sensor-compass",
"version": "1.0.0-alpha",
"dependency": "com.instapp.nat:weex-plugin-sensor-compass:1.0.0-alpha"
},
{
"type": "maven",
"groupId": "com.instapp.nat",
"name": "weex-plugin-device-screen",
"version": "1.0.0-alpha.1"
}
]
it worked; but in an interesting way: when installed a new module, the former one would worked correctly, it seems like the last one module's dependency always couldn't be installed currectly, don't know why this happens
I found the problem, the key dependency
is always missing in the last JSON object of the plugins array. You can add it manually and then the project will be worked fine.
Obviously, it's a problem cause by weexpack
, @erha19 bug report ;)
@Acathur @weenta see it, I will check it out soon.
@weenta @Acathur now you can upgrade your weexpack
to v1.1.5 to avoid this issue. try weex update weexpack@latest
, then add your plugins again.
Using module
nat-device-info
in android, when i get info of the device,in android studio,it has errors like this:Unhandled promise rejectionTypeError: device.info is not a function. (In 'device.info', 'device.info' is undefined)__ERROR
is there anything wrong in my code ? /index.vue
/plugins.json
environment: ubuntu 16.04 node 8.9.3 npm 5.6 weexpack 1.1.1 natjs 0.1.5