简体   繁体   English

camera.correctOrientation在PhonegapBuild上不起作用,但可以通过cordova-cli正常工作

[英]camera.correctOrientation doesn't work on PhonegapBuild while works fine via cordova-cli

I develop an app using Apache Cordova (aka phonegap). 我使用Apache Cordova(又名phonegap)开发了一个应用程序。 I use cordova-camera-plugin with the option correctOrrientation: true and I use also the cordova-device-orientation-plugin to enable this feature. 我将cordova-camera-plugin与选项correctOrrientation: true使用,并且我还使用了cordova-device-orientation-plugin来启用此功能。 And it works fine when I compile with cordova-cli : cordova run android . 当我使用cordova-cli编译时,它工作正常: cordova run android But I have to use Phonegap Build in order to compile for ios because I work on PC/Linux. 但是我必须使用Phonegap Build才能为ios进行编译,因为我在PC / Linux上工作。 So I compile for ios and android on phonegap build platform. 因此,我在phonegap构建平台上为ios和android进行了编译。

When compiling with phonegap build, the correctOrientation: true option seems ignored, or maybe the device-orientation plugin broken ? 使用phonegap构建进行编译时,更正了correctOrientation correctOrientation: true选项,或者设备定向插件损坏了吗?

Anyone know this issue ? 有人知道这个问题吗? What difference with phonegap build ? phonegap版本有什么区别?

There are my local plugins : 有我的本地插件:

$ cordova plugin ls
com.ionic.keyboard 1.0.2 "Keyboard"
nl.x-services.plugins.toast 2.0 "Toast"
org.apache.cordova.camera 0.3.0 "Camera"
org.apache.cordova.device 0.2.9 "Device"
org.apache.cordova.device-orientation 0.3.7 "Device Orientation"
org.apache.cordova.file 1.2.0 "File"
org.apache.cordova.file-transfer 0.4.4 "File Transfer"
org.apache.cordova.geolocation 0.3.8 "Geolocation"
org.apache.cordova.inappbrowser 0.5.0 "InAppBrowser"
org.apache.cordova.splashscreen 0.3.0 "Splashscreen"

And there is the configuration listed by phonegap build after uploaded my code on the platform : 在平台上上传我的代码后,phonegap构建列出了配置:

Installed Plugins

Apps will be built with the latest version of a plugin unless you lock the version in your config.xml (see below). -- Plugin installed as a dependency of another plugin

Third Party VERSION LATEST VERSION
de.appplant.cordova.plugin.local-notification       0.7.4   0.7.4

PhoneGap Core
-- org.apache.cordova.device    0.2.8   0.2.8
org.apache.cordova.camera       0.2.9   0.2.9
org.apache.cordova.device       0.2.8   0.2.8
org.apache.cordova.device-motion    0.2.6   0.2.6
org.apache.cordova.device-orientation       0.3.5   0.3.5
org.apache.cordova.dialogs      0.2.6   0.2.6
org.apache.cordova.file     1.0.1   1.0.1
org.apache.cordova.file-transfer    0.4.2   0.4.2
-- org.apache.cordova.file      1.0.1   1.0.1
org.apache.cordova.geolocation      0.3.7   0.3.7
org.apache.cordova.inappbrowser     0.3.3   0.3.3
org.apache.cordova.network-information      0.2.7   0.2.7
org.apache.cordova.splashscreen     0.2.7   0.2.7
org.apache.cordova.vibration    0.3.7   0.3.7

I note that the versions differs a little but ... that's some basics features no ? 我注意到版本有所不同,但是...这是一些基本功能,没有吗? Plus, I don't know how to upgrade the plugins on phonegap build, guess it is not possible... 另外,我不知道如何在phonegap构建上升级插件,我猜这是不可能的...

It is only caused by the version of the plugin. 它仅由插件的版本引起。 Phonegap build seems to encounter some difficulties to get their available plugins up to date. Phonegap构建似乎遇到一些困难,无法更新其可用插件。

When phonegap build say 'latest available version' for a plugin, it means on phonegap build platform , while offical repositories often spread more recent versions. 当phonegap构建说出插件的“最新可用版本”时,这意味着在phonegap构建平台上 ,而官方存储库通常会传播较新的版本。

Take care of that. 保重

If you must use phonegap build to build your releases, but use to run locally your apps for development and tests, check before using a new cordova plugin, that the phonegap build version exists and works for your usage. 如果必须使用phonegap构建来构建发行版,但必须用于在本地运行应用程序进行开发和测试,请在使用新的cordova插件之前进行检查,以确保phonegap构建版本存在并且可以使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM