We've released an app that had viro-react integrated into our Android binary, but we were intentionally not displaying any of the viro views.
Our build.gradle looks like the following:
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
Despite explicitly specifying minSdkVersion 16, we were surprised to find out that 13000 devices were suddenly excluded from downloading the app.
We're clueless of how this is possible.
Our goal was to not to exclude any devices, but only show the AR views on AR enabled hardware.
Is this possible to do with viro-react, on Android?
Hi @itchingpixels, yup this should be possible - we also have other developers that have successfully overwritten the min sdk version in ViroReact. When updating the minSdkVersion on the Google Play, did you update your app's version code as well? Also, when specifying the minSdkVersion 16, did you successfully override with this version in your manifest and recompile with the lower version?
Open Android Studio -> Open Manifest File
<uses-sdk tools:overrideLibrary="com.viromedia.virobridge,com.viro.renderer"/> xmlns:tools="http://schemas.android.com/tools" too, before the Hey @dthian, thank you for your answer. I'm from the same team as @itchingpixels.
I've just double-checked it and this is what we have in our manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-sdk tools:overrideLibrary="com.viromedia.virobridge, com.viro.renderer, com.viro.core" />
We needed to add the first two, because otherwise gradle was saying things like
Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library
Suggestion: use tools:overrideLibrary="com.viromedia.virobridge" to force usage
We have the minSdk specified in our build.gradle
And yes, we've definitely uploaded the version code, and recompiled the app. Do you have any suggestion what to check now?
Thank you for your help
Hi @fadani, can you send us your full manifest file so we can take a look and repro the issue on our end? Also are you using ARCore dev preview 2 or ARCore 1.0? You can email me at [email protected] if you prefer.
Hey @fadani, thanks again for reaching out. Firstly, the provided 13,000 unsupported devices that you have provided above is probably incorrect, unless you currently support all types of android devices like TV, PC, Wearables, etc.
Thus, which device types are you targeting? I would suggest applying a Form Factor filter (you can do this in the Google Play console) that targets those types to give you a more accurate number. In addition, please also apply an SDK >=16 filter as well in order to align with your gradle config above.
To further increase your app's device compatibility, you can add these overwrites to your manifest file to disable the gyroscope + acceleration components that may not be supported on certain devices. This should add a whole chunk of supported devices.
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" tools:replace="required" />
<uses-feature android:name="android.hardware.sensor.gyroscope" android:required="false" tools:replace="required" />
I would also recommend adding dynamic feature checks instead if you'd like, with Android's PackageManager.hasSystemFeature() check before attempting to run any VR / AR experiences.
Finally, please let us know:
@itchingpixels and @fadani also we just released ViroReact 2.4 which includes support for ARCore 1.0. We recommend that you upgrade to this version before submitting your app as it includes API's for detecting supported devices and downloading ARCore 1.0 apk from Google Play for the user. Release notes and upgrade instructions here -> https://docs.viromedia.com/docs/releases
Hey @dthian and @dam00n
Thank you for your answers.
Before integrating ARCore we had supported 13021 devices and after that around ~1800. So yes, it's only around 11200 devices that got filtered out.
What we would like to do is supporting tablets and phones with SDK >=16, and only making available the AR feature for those users who have AR compatible devices.
@dam00n yes, we are going to use the new ViroReact 2.4.0 soon. Thank you for the heads up!
Hey @fadani, can you please share if any filters were applied for the 13021 device number that you've gotten above (if any)?
Also, we've done more digging and have put together an aggressive list of uses-features that you can remove in order to increase API compatibility. Please ensure that you have these overwrites defined in your manifest file:
<uses-feature android:glEsVersion="0x00030000" android:required="false" tools:node="remove" tools:replace="required" />
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" tools:replace="required" />
<uses-feature android:name="android.hardware.sensor.gyroscope" android:required="false" tools:replace="required" />
<uses-feature android:name="android.hardware.camera" android:required="false" tools:replace="required" />
<uses-feature android:name="android.hardware.microphone" android:required="false" tools:replace="required" />
Note that from the above, we've removed requirements for opengl 3, accelerometer, gyroscope, camera, and the microphone. I'd recommend that you check for these required features during run-time to ensure that the device is AR-Capable.
Results:
After applying the recommended manifest overwrites above, our Viro APK was able to support 13050 devices (out of 15443 with no device filters). After applying an SDK filter of >=16, that ratio is narrowed to 13050 out of 13341 supported devices.
As such, the overrides mentioned above should help you achieve your target. Do let us know if you have difficulties applying the filters above, or have any additional questions or concerns.
Thank you all for your responses. These additional overrides in the manifest just solved everything! 馃檱
One last question: is there a specific reason that AR needs the microphone?
AR does not require microphone. But if you are using the screen record function that would require it.
Makes sense. Thank you!
Sounds great, resolving this issue then. Feel free to send us a support email should you have any additional questions.
Most helpful comment
Hey @fadani, can you please share if any filters were applied for the 13021 device number that you've gotten above (if any)?
Also, we've done more digging and have put together an aggressive list of uses-features that you can remove in order to increase API compatibility. Please ensure that you have these overwrites defined in your manifest file:
Note that from the above, we've removed requirements for opengl 3, accelerometer, gyroscope, camera, and the microphone. I'd recommend that you check for these required features during run-time to ensure that the device is AR-Capable.
Results:
After applying the recommended manifest overwrites above, our Viro APK was able to support 13050 devices (out of 15443 with no device filters). After applying an SDK filter of >=16, that ratio is narrowed to 13050 out of 13341 supported devices.
As such, the overrides mentioned above should help you achieve your target. Do let us know if you have difficulties applying the filters above, or have any additional questions or concerns.