React Native应用仅允许Google Play商店中的410个设备

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了React Native应用仅允许Google Play商店中的410个设备相关的知识,希望对你有一定的参考价值。

我在Google Play商店遇到问题,该商店坚持认为我的应用程序受410个设备支持。我在Google上传了app-x86-release.apk,它显示了支持的android设备410设备。我尝试过在社区和其他地方找到的所有解决方案,但没有运气

AndroidManifest.xml: -

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.animatedapp"
    android:versionCode="12"
    android:versionName="1.0">

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="26" />

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

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

    <application
      android:name=".MainApplication"
      android:allowBackup="true"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>                 
</manifest>

和build.gradle: -

apply plugin: "com.android.application"

import com.android.build.OutputFile



apply from: "../../node_modules/react-native/react.gradle"


def enableSeparateBuildPerCPUArchitecture = true


def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.3"

    defaultConfig {
        applicationId "com.animatedapp"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 14
        versionName "1.6"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

       signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }


    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release

        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    compile project(':react-native-custom-tabs')
    compile project(':react-native-cookie')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules     
    compile "com.android.support:appcompat-v7:25.0.1"
    compile project(':ReactNativeChromeCustomTabs')
    compile project(':RNWebView')
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}
答案

我猜那是因为你上传了“app-x86-release.apk”,它是用于x86架构的APK。 Google Play控制台向我展示了大约400个带有x86 arch的设备。

从您的gradle文件:

include "armeabi-v7a", "x86"

您的应用程序支持armeabi-v7a架构,也可以上传此版本。

以上是关于React Native应用仅允许Google Play商店中的410个设备的主要内容,如果未能解决你的问题,请参考以下文章

google 登录崩溃 Apk(React Native)

React Native InApp浏览器-选择要上传的文件(文件资源管理器),使InApp浏览器仅通过Google Chrome关闭

react native - react-native-maps initialRegion 不起作用

如何禁用屏幕旋转(react-native)?

将 Google 支付按钮和 Apple 支付按钮集成到 react-native 应用程序中

react-native-google-signin 与 AWS Cognito