Cordova 如何在定制之后重新编译ionic插件
我在爱奥尼亚编辑了插件,删除了平台,再次将平台安卓添加到应用程序中。但是,我的更改没有应用 插件:cordova lugin媒体捕获 最后增加了两个特性Cordova 如何在定制之后重新编译ionic插件,cordova,ionic-framework,hybrid-mobile-app,Cordova,Ionic Framework,Hybrid Mobile App,我在爱奥尼亚编辑了插件,删除了平台,再次将平台安卓添加到应用程序中。但是,我的更改没有应用 插件:cordova lugin媒体捕获 最后增加了两个特性 if(Build.VERSION.SDK_INT > 7){ intent.putExtra("android.intent.extra.durationLimit", req.duration); intent.putExtra("android.intent.extra.
if(Build.VERSION.SDK_INT > 7){
intent.putExtra("android.intent.extra.durationLimit", req.duration);
intent.putExtra("android.intent.extra.videoQuality", req.quality);
intent.putExtra("android.intent.extra.quickCapture", true); //added
intent.putExtra("android.intent.extras.CAMERA_FACING", android.hardware.Camera.CameraInfo.CAMERA_FACING_FRONT); //added
}
尝试将修改后的文件直接复制到平台src目录:
cp plugins/cordova-plugins-media-capture/src/android/Capture.java platforms/android/src/org/apache/codova/media-capture/
并重新构建该项目
我还建议您在更改前后放置几个Log.d(),以确保更改生效
Log.d("MODIFIED", "BEFORE platform check");
if(Build.VERSION.SDK_INT > 7){
Log.d("MODIFIED", "IN platform check");
(...)
}
Log.d("MODIFIED", "AFTER platform check");
还请记住,常数仅在API级别>=9时可用。最简单的方法是在platforms/android/src/[plugin folder]/[plugin filename]文件夹中直接编辑,该文件夹将在您构建应用程序时重新编译。测试通过后,您可以将更改应用到本地插件文件夹或任何适用的地方