Camera2 API compatibility issues with google play store - android

I have developed an android app that uses the camera2 API. I am able to run this app on my own physical device when I'm debugging, but when I try to publish the app to the google play store, it says that my device isn't compatible - in fact, no devices are compatible with my app.
I have been in contact with google support, and they said that "your app is not compatible with most devices due to a conflict in your app’s manifest because of the following missing device feature: android.hardware.camera2. "
I have noticed that the min-sdk version in my gradle file was set to 15.
So my question is: Will my app become compatible with my devices if I change the min-sdk version to 21, or do I need to rewrite my entire code to use the deprecated camera API instead?
Thanks in advance.
*Edit:
This is my android manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="...">
<uses-feature
android:name="android.hardware.camera2"
android:required="true"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:name=".app.AppController"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="barcode"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".ResultsActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".QRScanner"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

There is no such feature as "android.hardware.camera2", so if you require it for your app to be installable on a device, you won't be installable anywhere, since no device anywhere reports that feature.
The camera2 API exists on all devices running Android 5.0 or later, it doesn't have a feature. Remove the feature line, and use the min-sdk line if you don't want to deal with devices too old to support camera2.

Related

Unity Android App is not compatible with debugger device after publishing it on Play Store

I created an augmented reallity app using Unity and ARCore Foundation library, I used my Samsung A23 smartphone in order to test and debug it; after everything was working as expected, I published it on play store and after deployment was approved, I found out it is not compatible with my phone. Am I missing something?
https://play.google.com/store/apps/details?id=com.Anarvista.anARVistAPP&hl=es
Google Play Store requires the app to set Target API Level to 31 which matches with my cellphone, minimun API Level is set to 28 (Android 9.0 Pie)
This is manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="com.google.ar.core.depth" />
<uses-feature android:glEsVersion="0x00030000" />
<application android:icon="#drawable/app_icon" android:label="#string/app_name">
<activity android:name="jp.fantom1x.plugin.android.fantomPlugin.FullPluginOnUnityPlayerActivity"
android:label="#string/app_name"
android:exported="true"
android:screenOrientation="sensorPortrait"
android:launchMode="singleTask"
android:theme="#android:style/Theme.DeviceDefault.Light.NoActionBar.Fullscreen"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Unity Build Settings
I am expecting this app being available and compatible with my Samsung A23 cellphone since I used it for debugging this app before publishing it.

Cannot open Camera An error occurred while connecting to camera: 0

I started developping an app and I need to use the camera of my phone, and when I use the method Camera.open(), either with cameraId or not, it returns the error "An error occurred while connecting to camera: 0". My AndroidManifest.xml is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.telecombretagne.holowater">
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.autofocus" />
<uses-feature android:name="android.hardware.flash" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".camera"
android:label="#string/title_activity_camera"
android:theme="#style/AppTheme.NoActionBar"></activity>
</application>
</manifest>
My phone's Android Version is 6.0.1, and it's a BQ Aquaris M5.
Thanks in advance.
Devices that are running Marshmallow requires permission to be set on runtime, here's my answer from another similar question here :)
From https://developer.android.com/training/permissions/requesting.html
Note: Beginning with Android 6.0 (API level 23), users can revoke permissions from any app at any time, even if the app targets a lower API level. You should test your app to verify that it behaves properly when it's missing a needed permission, regardless of what API level your app targets.
Aside from the permissions set in the manifest, you'll need to request/check for permission on runtime. There are sample codes in there you can use, or...
Quick solution,
go to Settings-> Apps->(Your app name)->Permissions and enable the camera permission.
Done, although not recommended for final product
then try your app again. Should be working now :D
try also adding the camera ID, like
Camera.open(Camera.CameraInfo.CAMERA_FACING_BACK);

Can't install APK correctly on device

I have built & sign my apk by Eclipse ADT as it is describes (export and sign by creating a new key). But it can't be install on real device while an errors occurs, such as "installer package error". I have no Android device & sent my apk to friends by email. I'm using AVD and everyth is fine with it. Any suggestions? Thanx guys.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.XXXX.YYYY"
android:versionCode="0"
android:versionName="0.9.2" android:installLocation="internalOnly">
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:hardwareAccelerated="true"
android:permission="android.permission.INTERNET"
android:allowBackup="true">
<activity
android:name="com.XXXX.YYYY.ActivityMain"
android:label="#string/main_activity_title"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.XXXX.YYYY.ActivityDetails"
android:parentActivityName="com.XXXX.YYYY.ActivityMain"
android:excludeFromRecents="true"
android:configChanges="orientation|screenSize">
</activity>
</application></manifest>
UPD: apk installs good, but the error occurs if choose Open (see screenshot). After that app works fine. But on tablet if try open app it says "App deleted".
UPD2: add supporting API 4+ meta tag for the 2nd activity, but it takes no effect
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.XXXX.YYYY.ActivityMain" />
You probably need to make sure your device and your friend's devices can install apps that are not from the play store.
This is a feature you have to specifically set, or else apps that are outside the play store will not install.
Here is how to set it:
Open settings
Find the Security settings (Pre 4.0 it is under Applications)
Look for a setting that says Unknown sources, or non-market apps
Enable that setting
Everything should work after that!
Here is an article with pictures if you are still confused :)
Your example was missing the closing </manifest> and android:enabled. I'm not sure if the latter would prevent a device from fully installing it but the first one would.
I've also had issues using the full activity names in the past, so you may want to try using simplifying them to see if it helps.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.XXXX.YYYY"
android:versionCode="0"
android:versionName="0.9.2" android:installLocation="internalOnly">
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:hardwareAccelerated="true"
android:allowBackup="true">
<activity
android:name=".ActivityMain"
android:label="#string/main_activity_title"
android:enabled="true"
android:permission="android.permission.INTERNET"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ActivityDetails"
android:parentActivityName=".ActivityMain"
android:excludeFromRecents="true"
android:configChanges="orientation|screenSize">
</activity>
</application>
</manifest>
Is "Unknown sources" option under "security" allowed on device?
My problem was a duplicate internet permission request on Manifest! When I remove that from activity app was run normally.

Android app suddenly not compatible with devices

I have an Android app that has been in the Google Play store for about two years now (https://play.google.com/store/apps/details?id=dkh.idex) with API level 7+ and support for all screen sizes. It uses a few permissions (ACCESS_NETWORK_STATE, INTERNET, READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE).
On April 22 2013 I uploaded a version (version code 44) that worked fine on all my users devices. A month later, on May 22 2013 I uploaded a new version with some minor changes (version code 45), but the last few days (starting May 27) a lot of users has complained to me that their devices no longer are compatible with the newest version of my app. These users have been using the app with no such problems for up to two years. Some devices are still able to upgrade to the newest version, but others get the message that their device is not compatible when trying to upgrade (mind you, they already have an older version of the app). I was able to install the application directly through ADB (USB) on a device that said it was not compatible in the Google Play store (a Samsung Galaxy Tab 10.1, old version).
I looked through my changesets of my files, and the only change I have made in the AndroidManifest.xml between the two releases are updating the version code and version number. I have not changed any use permissions, supported screen sizes, supported API levels or even added any activities or changed debug settings.
Here is my AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dkh.idex"
android:versionName="3.2.11" android:versionCode="45">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />
<uses-sdk android:minSdkVersion="7"/>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application android:name="dkh.classes.MyApp" android:label="#string/app_name" android:debuggable="false" android:icon="#drawable/ic_launcher_idex_v3">
<activity android:name=".idex"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Form2"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="orientation">
</activity>
<activity android:name=".InfoForm"
android:label="#string/app_name"
android:screenOrientation="portrait">
</activity>
<activity android:name=".INSTAForm"
android:label="#string/app_name"
android:launchMode="standard"
android:screenOrientation="portrait">
</activity>
<activity android:name=".HygieneForm"
android:label="#string/app_name"
android:screenOrientation="portrait">
</activity>
<activity android:name=".CommentForm"
android:label="#string/app_name"
android:screenOrientation="portrait">
</activity>
<activity android:name=".AddReqChooseForm"
android:label="#string/app_name"
android:screenOrientation="portrait">
</activity>
<activity android:name=".AddReqForm"
android:label="#string/app_name"
android:screenOrientation="portrait">
</activity>
<activity android:name=".FTPForm" android:label="#string/app_name" android:screenOrientation="portrait"></activity>
<activity android:name=".SyncForm" android:label="#string/app_name" android:screenOrientation="portrait"></activity>
<activity android:name=".DrawTestForm" android:label="#string/app_name" android:configChanges="keyboardHidden|orientation"></activity>
<activity android:name="StatisticsForm" android:screenOrientation="portrait" android:label="#string/app_name"></activity>
<activity android:name="PhotoGallery" android:screenOrientation="portrait" android:label="#string/app_name"></activity>
<activity android:name="PhotoView" android:label="#string/app_name"></activity>
<activity android:name="ParametersForm" android:label="#string/app_name" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan"></activity>
<activity android:name="PropertiesForm" android:label="#string/app_name" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan"></activity>
<activity android:screenOrientation="portrait" android:name="InspectionChangeForm" android:label="#string/app_name"></activity>
<activity android:name="AdvancedSyncWindow" android:label="#string/app_name" android:screenOrientation="portrait"></activity>
<service android:process=":image_process" android:name=".ImageUploadService"></service>
<activity android:name=".HelpWindow" android:label="#string/app_name"></activity>
<activity android:name="RecoverView"></activity>
<activity android:name="InspectionCommentForm" ></activity>
</application>
</manifest> `
In the rest of my code I have added some texts to my resource files and made some standard minor changes, but nothing that weren't in the app already in some form.
I am really puzzled by this problem. Does anyone know what could be the cause of this or know if Google has changed anything that could have an effect on this? Please ask if you need more information.
I solved it.
The problem was that Google Play will filter applications based on the device screen size, and because xlargeScreens are not supported in API 7 (version 2.1) the filter will be set to false on these devices. This has not been enforced until end of May. My app had worked on the exact same specification for two years, but I suspect that Google Play has made an update to enforce this constraint.
The solution: If you have an app that is developed for API 7 but you want it to be available on xlargeScreens devices, you have to set in your manifest
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="9" />
If either minSdkVersion or targetSdkVersion is 9 or larger, Google Play will allow xlargeScreen devices to see your app.

Google TV : Supported Android devices 0 devices

image link
this is my Google TV application manifest which i uploaded on google play end i get message "0 devices are suported" can someone tell my what i'm making wrong
(i want to target googleTV devices)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="*******"
android:versionCode="12"
android:versionName="1.081" >
<uses-sdk
android:minSdkVersion="3"
android:targetSdkVersion="17"
android:maxSdkVersion="17"/>
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<uses-feature android:name="com.google.android.tv" android:required="true"/>
<application
android:name=".App"
android:icon="#drawable/logo_min"
android:label="#string/app_name" >
<activity
android:name=".WelcomeActivity"
android:label="#string/title_activity_main" >
<!-- android:screenOrientation="landscape" -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
You might wish to use "aapt dump badging " to see, but it looks like something in your APK is requesting native tools (Native Platforms in your chart) - perhaps a library you included?
For sure using anything native will keep you from being seen on a Google TV currently.
I'm also a bit concerned about the uppercase TV in Features.
I think your minSdkVersion needs to be 11.
Reference:
https://developers.google.com/tv/android/docs/gtv_market_publishing_checklist

Categories

Resources