简体   繁体   English

添加库后,此版本仍不符合 Google Play 64 位要求错误

[英]This release is not compliant with the Google Play 64-bit requirement error still after adding libraries

I am uploading a video editor app on play store that has libraries with some native code.我正在 Play 商店上传一个视频编辑器应用程序,该应用程序具有带有一些本机代码的库。 So I made it compatible for 64bit by adding this to gradle.所以我通过将它添加到 gradle 使其兼容 64 位。

ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'

Adding it still problem is not solved .添加它仍然问题没有解决。 When I upload on playstore it still gives 64bit error.当我在 Playstore 上传时,它仍然出现 64 位错误。 This is my gradle这是我的毕业证

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.maam.videoeditor"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 5
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation "com.android.support:customtabs:28.0.0"
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'

    implementation 'com.writingminds:FFmpegAndroid:0.3.2'

}

I have added 64bit line in gradle but on uploading 64bit not compliant error shows.我在 gradle 中添加了 64 位行,但在上传 64 位不合规错误显示。 Kindly guide on solving this problem.请指导解决这个问题。

@Osama: First of all, please check if your apk file have library in 64 bit. @Osama:首先,请检查您的 apk 文件是否有 64 位库。 There are many way to do this: - Use Analyze Apk function of Android Studio (for more detail, please refer: https://developer.android.com/distribute/best-practices/develop/64-bit ) - Archive your apk file and check inside that folder.有很多方法可以做到这一点: - 使用 Android Studio 的分析 Apk 功能(更多详细信息,请参阅: https : //developer.android.com/distribute/best-practices/develop/64-bit ) - 存档您的 apk文件并检查该文件夹内。 If your app doesn't has folder "arm64-v8a" it mean your app still not versioned up to 64 bit.如果您的应用程序没有文件夹“arm64-v8a”,则意味着您的应用程序版本仍未达到 64 位。

About your requirement, if you want your app is support 64 bit architecture, you must also version up your native library (.so file) to 64 bit.关于您的要求,如果您希望您的应用程序支持 64 位架构,您还必须将您的本机库(.so 文件)版本升级到 64 位。

About your code:关于你的代码:

ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'"

I don't recommend you add this unless you use AppBundle new feature of Android Studio.我不建议你添加这个,除非你使用 Android Studio 的 AppBundle 新功能。 Because when you use this, there will be 4 new apk file created for each architecture.因为当你使用它时,将为每个架构创建4个新的apk文件。 And if you upload the file of arm64-v8a architecture, the error will disappear but it will announce you that your apk is support less device than previous release because it cannot support 32 bit device.如果你上传 arm64-v8a 架构的文件,错误会消失,但它会通知你你的 apk 支持的设备比以前的版本少,因为它不支持 32 位设备。

There are 2 possible solution for this problem:这个问题有两种可能的解决方案:

  1. Put all library file to your apk file, it will make your app bigger but it will allow your app to support every device.把所有的库文件放到你的 apk 文件中,它会让你的应用程序更大,但它会让你的应用程序支持所有设备。

  2. Apply AppBundle for your project.为您的项目应用 AppBundle。 For more detail about this, please check this link: https://android.jlelse.eu/a-practical-guide-to-android-app-bundle-for-beginners-7e8d93831828有关这方面的更多详细信息,请查看此链接: https : //android.jlelse.eu/a-practical-guide-to-android-app-bundle-for-beginners-7e8d93831828

android {    
    compileSdkVersion 29    
    defaultConfig {    
        -----    
        -----    
        ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'    
        ndk {    
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'    
        }    
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"    
    }    

    packagingOptions {    
            exclude 'lib/armeabi-v7a/libvudroid.so'    
            exclude 'lib/x86/libvudroid.so'    
            exclude 'lib/arm64-v8a/libvudroid.so'    
        }    

Google has released Flutter 1.7.8+hotfix.3 in stable channel, which makes easy to build app for release. Google已在稳定的渠道中发布了Flutter 1.7.8 + hotfix.3,可轻松构建要发布的应用程序。

Now you have two options to build : 现在,您有两个选择可以构建:

  1. App bundle (preferred) 应用捆绑包(首选)
  2. APK APK

Generating App Bundle 产生应用程式套件

Run flutter build appbundle 运行flutter build appbundle

This will create <app dir>/build/app/outputs/bundle/release/app.aab 这将创建<app dir>/build/app/outputs/bundle/release/app.aab

T app bundle contains your Dart code and the Flutter runtime compiled for armeabi-v7a (32-bit) and arm64-v8a (64-bit). T app捆绑包包含Dart代码和为armeabi-v7a (32位)和arm64-v8a (64位)编译的Flutter运行时。

Now you can upload this app bundle to google play. 现在,您可以将此应用捆绑包上传到Google Play。

Build an APK 建立一个APK

flutter build apk --split-per-abi

This command results in two APK files: 此命令产生两个APK文件:

<app dir>/build/app/outputs/apk/release/app-armeabi-v7a-release.apk
<app dir>/build/app/outputs/apk/release/app-arm64-v8a-release.apk

Removing the --split-per-abi flag results in a fat APK that contains your code compiled for all the target ABIs. 删除--split-per-abi标志将导致显示一个胖APK,其中包含为所有目标ABI编译的代码。 Such APKs are larger in size than their split counterparts, causing the user to download native binaries that are not applicable to their device's architecture. 此类APK的大小要大于拆分后的对应文件,导致用户下载不适用于其设备架构的本机二进制文件。

If you haven't upgraded to flutter 1.7 Below solution should still work. 如果您尚未升级到Flutter 1.7,则下面的解决方案仍然可以使用。

You need to build two apk and upload it together. 您需要构建两个apk并将其一起上传。 one for 32 and another for 64 bit. 一个用于32位,另一个用于64位。

This is what worked for me i am on flutter v1.5.4-hotfix.2 这是我对flutter v1.5.4-hotfix.2的工作原理

First run flutter build apk --release and upload the apk file 首先运行flutter build apk --release并上传apk文件

Then increase the version and build number in pubspec.yml file and run 然后在pubspec.yml文件中增加版本和内部版本号并运行

flutter build apk --release --target-platform=android-arm64

Upload this new apk and start rollout. 上载此新apk并开始推出。

Good luck 祝好运

从我的情况来看,谷歌支持团队的回答是,这是由于上传了较旧的(旧版)版本构建(不符合 64 位要求),在上传新版本时将其包含在“上一个版本”部分应用。

You need to add the following to your android/app/build.gradle file:您需要将以下内容添加到您的 android/app/build.gradle 文件中:

android {    
    defaultConfig {
        ....
        ....
        ndk {
            abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
}

add the following to your android/build.gradle file:将以下内容添加到您的 android/build.gradle 文件中:

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                .....
                .....

                packagingOptions {
                    pickFirst 'lib/x86/libc++_shared.so'
                    pickFirst 'lib/arm64-v8a/libc++_shared.so'
                    pickFirst 'lib/x86_64/libc++_shared.so'
                    pickFirst 'lib/armeabi-v7a/libc++_shared.so'
                }
            }
        }
    }
}

This is to include the 64-bit architecture.这是为了包括 64 位架构。 If not this, then you might need to create app bundle and then upload如果不是这样,那么您可能需要创建应用程序包然后上传

If you upload your apk on alpha version and this error will be show, so please check if any exiting apk is live or not if not live so please remove your old apk and upload your new apk.如果您在 alpha 版本上上传您的 apk 并且会显示此错误,因此请检查任何退出的 apk 是否已上线,如果没有,请删除您的旧 apk 并上传您的新 apk。

I think your problem is solve.我想你的问题已经解决了。

我遇到了同样的情况...我的应用程序既不是游戏也不是跨平台应用程序...我遇到过这种情况...解决方案很简单...我的一个应用程序依赖(由gradle实现的库)正在使用ndk ...我删除它后,问题就消失了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 此版本不符合 Google Play 64 位要求错误 - This release is not compliant with the Google Play 64-bit requirement error 此版本不符合Google Play 64位要求。 本机Java应用程序已经存在所有.so - This release is not compliant with the Google Play 64-bit requirement. All .so already exists for native java app Google Play 64 位要求 - Google Play 64-bit requirement 我必须对64位要求进行哪些修改? - What I have to modifiy for the 64-bit requirement? maven-surefire-plugin失败,错误为“无法在64位JVM上加载32位SWT库” - maven-surefire-plugin fails with error “Cannot load 32-bit SWT libraries on 64-bit JVM” Apex数据加载器 - 错误java.lang.UnsatisfiedLinkError:无法在64位JVM上加载32位SW T库 - Apex Data loader - Error java.lang.UnsatisfiedLinkError: Cannot load 32-bit SW T libraries on 64-bit JVM Google Play 64位合规性 - Google Play 64 Bit Compliance 在 Android Studio 中添加 64 位库 - Adding 64 bit libraries in Android studio Android 应用程序在添加 NDK 后不兼容 64 位 { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' } - Android app not 64 bit compliant after adding NDK { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' } 添加 &#39;ndk { abiFilters &#39;armeabi-v7a&#39;,&#39;arm64-v8a&#39;,&#39;x86&#39;,&#39;x86_64&#39; }&#39; 后,Android 应用程序不兼容 64 位 - Android app not 64 bit compliant after adding 'ndk { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' }'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM