android 在Google Play上上传,但许多设备不支持

68de4m5k  于 2022-11-03  发布在  Android
关注(0)|答案(2)|浏览(187)

我最近上传了一个应用程序,我已经通过谷歌播放控制台在Google Play。出于某种原因,我真的不明白在所有的设备这是我第一次使用Google Play控制台,因为这款应用通过了Google的审核流程,我真的不明白为什么会发生这种情况。我找到了设备目录选项卡,但我没有在那里放置任何排除项。
在我通过Google Play控制台上传应用程序后,我已经将应用程序发送给了朋友和家人,大约20人左右,但他们都无法下载应用程序。同样的事情也发生在我的2台设备上。
这是旅客名单

<uses-feature
    android:name="android.hardware.Camera"
    android:required="true" />

<queries>
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent>
</queries>

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

<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/Theme.PITAFLPantryManager">
    <activity
        android:name=".ShoppingListActivity"
        android:parentActivityName=".MainActivity" />
    <activity android:name=".TextRecognitionActivity" />
    <activity android:name=".BarcodeScannerActivity" />
    <activity
        android:name=".ProductsActivity"
        android:parentActivityName=".MainActivity">
        <meta-data android:name="android.app.default_searchable"
            android:value=".SearchableActivity" />
    </activity>
    <activity
        android:name=".SettingsActivity"
        android:exported="false"
        android:label="@string/title_activity_settings"
        android:parentActivityName=".MainActivity"/>
    <activity android:name=".AboutActivity"
        android:parentActivityName=".MainActivity" />
    <activity android:name=".SearchableActivity"
        android:launchMode="singleTop"
        android:exported="false">
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
            android:resource="@xml/searchable" />
    </activity>
    <activity android:name=".MainActivity"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <meta-data android:name="android.app.default_searchable"
            android:value=".SearchableActivity" />
    </activity>

    <meta-data
        android:name="com.google.mlkit.vision.DEPENDENCIES"
        android:value="ocr" />

    <!--service
        android:name=".ProductsWatcherWorker"
        android:permission="android.permission.BIND_JOB_SERVICE"></service-->
</application>

还有那个建筑师

plugins {
    id 'com.android.application'
}

// Creates a variable called keystorePropertiesFile, and initializes it to the
// keystore.properties file.
def keystorePropertiesFile = rootProject.file('keystore.properties')

// Initializes a new Properties() object called keystoreProperties.
def keystoreProperties = new Properties()

// Loads the keystore.properties file into the keystoreProperties object.
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
    signingConfigs {
        debug {
            keyAlias keystoreProperties['debugKeyAlias']
            keyPassword keystoreProperties['debugKeyPassword']
            storeFile file(keystoreProperties['debugStoreFile'])
            storePassword keystoreProperties['debugStorePassword']
        }
        release {
            keyAlias keystoreProperties['releaseKeyAlias']
            keyPassword keystoreProperties['releaseKeyPassword']
            storeFile file(file(keystoreProperties['releaseStoreFile']))
            storePassword keystoreProperties['releaseStorePassword']
        }
    }
    compileSdkVersion 32
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.timkom.pitafl"
        minSdkVersion 27
        targetSdkVersion 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            packagingOptions {
                exclude 'AndroidManifest.xml'
                exclude 'resources.arsc'
            }
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            debuggable false
            jniDebuggable false
            renderscriptDebuggable false
            zipAlignEnabled false
            signingConfig signingConfigs.release
        }
        debug {
            signingConfig signingConfigs.debug
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildFeatures {
        viewBinding true
    }

    configurations {
        compile.exclude group: 'com.google.android'
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel:2.3.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
    implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
    implementation 'androidx.fragment:fragment:1.3.6'
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    implementation 'com.github.bigfishcat.android:svg-android:2.0.8'
    implementation 'androidx.work:work-runtime:2.5.0'
    implementation 'androidx.preference:preference:1.1.0'
    implementation 'com.google.mlkit:barcode-scanning:17.0.2'
    implementation "androidx.camera:camera-camera2:1.0.2"
    implementation "androidx.camera:camera-lifecycle:1.0.2"
    implementation "androidx.camera:camera-view:1.0.0-alpha23"
    implementation 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

android.applicationVariants.all { variant ->
    variant.outputs.all {
        outputFileName = "${applicationId}-${variant.name}-${variant.versionName}.apk"
    }
}
8aqjt8rx

8aqjt8rx1#

虽然您发现了清单中有问题的部分,但问题并不是您所认为的那样-功能的名称与相机API的包名称无关。
https://developer.android.com/reference/android/hardware/Camera是旧的相机API,https://developer.android.com/reference/android/hardware/camera2/是新的相机API,但两者都与软件包管理器功能相关,如:

  • https://developer.android.com/reference/android/content/pm/PackageManager?hl=en#FEATURE_CAMERA(需要后置摄像头)、
  • https://developer.android.com/reference/android/content/pm/PackageManager?hl=en#FEATURE_CAMERA_ANY(需要任何摄像头),
  • https://developer.android.com/reference/android/content/pm/PackageManager?hl=en#FEATURE_CAMERA_FRONT(需要前置摄像头)

您的问题是FEATURE_CAMERA字符串是“android.hardware.camera“,* 而不是 *“android.hardware.Camera”。它区分大小写。
除非您只使用后置摄像头,否则您可能需要FEATURE_CAMERA_ANY,“android.hardware.camera.any”。
而且如果你的应用程序没有摄像头就没用的话,最好把功能按要求列出。否则,把它列为android:required="false"可能是最好的。

mrphzbgm

mrphzbgm2#

我已经发现了这个问题。我从清单中删除了下面的行,因为我不使用旧的相机API。

<uses-feature
    android:name="android.hardware.Camera"
    android:required="true" />

相关问题