android - 即时应用程序,立即尝试按钮不会出现在 Play 商店中

标签 android google-play android-instant-apps dynamic-feature-module

我从以下 github 项目开始,但这些示例无法正常工作。我添加了文档中所述的缺失部分。
https://github.com/android/app-bundle-samples/tree/main/InstantApps/urlless
https://github.com/googlecodelabs/android-dynamic-features
这是我阅读的文档。
https://developer.android.com/topic/google-play-instant/getting-started/instant-enabled-app-bundle
https://developer.android.com/topic/google-play-instant/feature-module-migration
https://developer.android.com/guide/app-bundle/instant-delivery
我尝试实现一个简单的 hello world 即时应用程序。我尝试了很多东西,但现在尝试按钮从未出现在 Play 商店中。
我的应用程序包含 2 个模块:

  • 应用
  • 即时应用

  • app 模块的 build.gradle :
    apply plugin: 'com.android.application'
    apply plugin: 'com.google.gms.google-services'
    
    android {
        compileSdkVersion 30
        defaultConfig {
    
            minSdkVersion 21
            targetSdkVersion 30
            versionCode 61
            versionName "61"
            multiDexEnabled true
        }
        buildTypes {
            release {
                minifyEnabled true
                shrinkResources false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
            debug {
                debuggable true
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        dynamicFeatures = [':instantapp']
    }
    
    dependencies {
        ...
        implementation "com.google.android.gms:play-services-instantapps:17.0.0"
        implementation "com.google.android.play:core:1.9.0"
        ...
    }
    
    我的即时应用模块的 build.gradle
    plugins {
        id 'com.android.dynamic-feature'
    }
    android {
        compileSdkVersion 30
        buildToolsVersion "30.0.2"
    
        defaultConfig {
            applicationId "com.test.myapp"
            minSdkVersion 21
            targetSdkVersion 30
            versionCode 3
            versionName "1.2"
        }
    }
    
    dependencies {
        
        implementation "com.google.android.play:core:1.9.0"
       
    }
    
    我的应用模块的 AndroidManifest.xml
    <?xml version="1.0" encoding="utf-8"?>
    <manifest >
    
        <dist:module dist:instant="true" />
    
        ...
    
    </manifest>
    
    我的即时应用模块的 AndroidManifest.xml
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:dist="http://schemas.android.com/apk/distribution"
        package="com.test.instantapp"
        android:targetSandboxVersion="2">
    
        <dist:module dist:instant="true" dist:onDemand="false"
            dist:title="Instant app title">
            <dist:fusing dist:include="true" />
        </dist:module>
    
        <application android:usesCleartextTraffic="false">
            <activity android:name=".InstantMainActivity">
                <intent-filter>
                   <action android:name="android.intent.action.MAIN" />
                   <category android:name="android.intent.category.LAUNCHER" />
               </intent-filter>
            </activity>
        </application>
    
      
    </manifest>
    
    我生成了一个签名包,并在每次尝试中将其上传到内部测试中,但它不起作用。我也在产品环境中尝试过。不行!
    我试图将 applicationId "com.test.myapp"放在应用程序模块和即时应用程序模块中。我尝试制作 android:targetSandboxVersion="2"和 android:targetSandboxVersion="1"。不行
    .
    我的应用程序的版本代码大于我的免安装应用程序的版本代码,如下所示。
    我删除了 clearTextTraffic 并添加了。不行!
    有人说我将启用即时应用程序的代码投入生产并上传新的升级即时应用程序版本。我做到了,它也没有工作。
    我尝试了许多我现在不记得的组合。但是现在尝试按钮永远不会出现。我找不到的缺失部分是什么?
    关于 Instant-app 模块的最大大小有 3 种不同的说法:
  • 4 mb
  • 10 mb
  • 15 兆
    为什么源代码和文档冲突太多,而且 github 中没有工作代码?如果我在 Play 商店中没有看到工作样本,我会认为即时应用程序已经死了。
  • 最佳答案

    打开Play商店->选择应用程序->打开高级设置->添加发布类型即时应用程序
    enter image description here
    然后从仅即时应用选项上传您的即时应用:
    enter image description here

    关于android - 即时应用程序,立即尝试按钮不会出现在 Play 商店中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65918686/

    相关文章:

    android - 如何将事件从一个 fragment 中的列表适配器发送到另一个 fragment ?

    android - GCM 演示服务器 - 指定消息

    android - 如何处理有关 Flurry Analytics 的 “android-security” 和 “TrustManager” 问题?

    android - 您可以在 google play 的 alfa 和 beta 测试期间使用 admob 吗?

    android - 暂停/反转帧动画?

    android - 部署/发布使用 React Native 制作的 Android 应用

    AndroidAnnotations + Instant App - 找不到生成的 <applicationId>.R 类

    android - 您的免安装应用 APK 的版本代码为 'X',该版本已在使用中

    android - 在 Android Instant Apps 的情况下,Fabric 初始化无法计算应用程序图标的哈希值

    android - Android 中的 DalvikVM 与 JavaVM 的对比?