Release build removes camera permission
So based on the other thread, but completely different. I have figured out the issue. Doing a release build is removing the CAMERA permission in the AndroidManifest.xml. I am using this in the config.xml:
<preference name="android-manifest/uses-permission/[@android:name='android.permission.CAMERA']/@android:name" delete="true" /> <preference name="android-manifest/uses-permission/[@android:name='android.permission.READ_EXTERNAL_STORAGE']/@android:name" delete="true" />
READ_EXERNAL_STORAGE makes it into the APK, but not camera. I verified this by decompiling the APK.
I have confirmed this is an issue with Monaca remote build and the custom config plugin. Although the Monaca docs state the aforementioned code will work, the docs for the plugin state that remote builds will fail. Not certain the exact cause here, but I did a straight Cordova local build with the exact same plugins minus the Monaca ones and doing a release build works exactly like it is supposed too.
Since I am using navigator.mediaDevices.getUserMedia as I need webRTC access, I am using this plugin to request permissions at runtime: https://github.com/dpa99c/cordova-diagnostic-plugin. There is some issue with the remote build and custom-config plugin that is removing the camera permission but not the others. Interesting bug none-the-less and local building with a traditional cordova project solves the issue.