App not compatible with your device. ALL devices

After publishing my app, I got the message it's not compatible with my device. even though I test it in the same device. The "error" message is showing for everyone who tries to download the app, like it's not compatible with your device. Folow the Gradle:

    apply plugin: 'com.android.application'
   apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.ths.dev.cadeoprefeito"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0-alpha3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3'
    //FirebaseCORE
    implementation 'com.google.firebase:firebase-core:16.0.4'
    //FirebaseDatabase
    implementation 'com.google.firebase:firebase-database:16.0.3'
    //ADSFirebase
    implementation 'com.google.firebase:firebase-ads:16.0.1'
    //FirebaseAUTH
    implementation 'com.google.firebase:firebase-auth:16.0.4'
    //FirebaseStorage
    implementation 'com.google.firebase:firebase-storage:16.0.3'
    //FirebaseUI
    implementation 'com.firebaseui:firebase-ui-storage:0.6.0'
}

the Manifest:

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ths.dev.cadeoprefeito">

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <!-- Permissões para foto -->
    <uses-permission android:name="android.permission.CAMERA" />

    <uses-feature android:name="android.hardware.camera2" />

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <!--
             The API key for Google Maps-based APIs is defined as a string resource.
             (See the file "res/values/google_maps_api.xml").
             Note that the API key is linked to the encryption key used to sign the APK.
             You need a different API key for each encryption key, including the release key that is used to
             sign the APK for publishing.
             You can define the keys for the debug and release targets in src/debug/ and src/release/. 
        -->
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_maps_key" />

        <activity
            android:name=".Activity.MapsActivity"
            android:label="Cadê o Prefeito"
            android:screenOrientation="portrait">
        </activity>

        <activity
            android:name=".Activity.SplashActivity"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

I don't know what i can do. Any help?

Upvotes: 3

Views: 112

Answers (2)

Martin Zeitler
Martin Zeitler

Reputation: 76669

don't think android.hardware.camera2 is the reason, which is commonly available on current devices - when not requiring it, one has to provide the legacy camera as a fallback option (with a maps and splash-screen activity, I'd rather wonder for what it shall be good for). the reason is rather: a) add the supports-screens element to the Manifest.xml... because without it, no single screen size is being supported. and b) add apply plugin: 'com.google.gms.google-services' at the bottom of the file.

Google Play Store screenshot

Upvotes: 0

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75788

You should add android:required="false" in android:name="android.hardware.camera2" section.

When you declare android:required="false" for a feature, it means that the application prefers to use the feature if present on the device, but that it is designed to function without the specified feature, if necessary.

 <uses-feature android:name="android.hardware.camera2" android:required="false"/>

Upvotes: 5

Related Questions