Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 即时应用,立即试用按钮未出现在play store中_Android_Google Play_Android Instant Apps_Dynamic Feature Module - Fatal编程技术网

Android 即时应用,立即试用按钮未出现在play store中

Android 即时应用,立即试用按钮未出现在play store中,android,google-play,android-instant-apps,dynamic-feature-module,Android,Google Play,Android Instant Apps,Dynamic Feature Module,我从以下github项目开始,但这些示例无法正常工作。我按照文档中的说明添加了缺失的部分。 这是我读过的文件。 我尝试实现一个简单的hello world即时应用程序。我尝试了很多东西,但“立即尝试”按钮从未出现在play store中 我的应用程序包含2个模块: 应用程序 即时应用 应用程序模块的build.gradle: apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-servi

我从以下github项目开始,但这些示例无法正常工作。我按照文档中的说明添加了缺失的部分。

这是我读过的文件。

我尝试实现一个简单的hello world即时应用程序。我尝试了很多东西,但“立即尝试”按钮从未出现在play store中

我的应用程序包含2个模块:

  • 应用程序
  • 即时应用
应用程序模块的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"
   
}
<?xml version="1.0" encoding="utf-8"?>
<manifest >

    <dist:module dist:instant="true" />

    ...

</manifest>
<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>
我的应用程序模块的AndroidManifest.xml

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"
   
}
<?xml version="1.0" encoding="utf-8"?>
<manifest >

    <dist:module dist:instant="true" />

    ...

</manifest>
<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>

...
我的即时应用程序模块的AndroidManifest.xml

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"
   
}
<?xml version="1.0" encoding="utf-8"?>
<manifest >

    <dist:module dist:instant="true" />

    ...

</manifest>
<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>

我在每次尝试中生成一个签名包并在内部测试中上传它,但它不起作用。我也在prod环境中尝试过。不行

我尝试将applicationId“com.test.myapp”放在应用程序模块和即时应用程序模块中。我试着让android:targetSandboxVersion=“2”和android:targetSandboxVersion=“1”。不行 . 我的应用程序的版本代码大于我的即时应用程序的版本代码,如下所示

我删除了clearTextTraffic并添加了。不行

有人说我需要将我的即时应用程序代码投入生产,并上传一个新的升级版即时应用程序。我做了,也没用

我试过很多组合,现在记不起来了。但“立即尝试”按钮从未出现。我找不到的缺失部分是什么

即时应用程序模块的最大大小有3种说法:

  • 4MB
  • 10 mb
  • 15 mb 为什么源代码和文档冲突太多,而github中没有工作代码?若我并没有在play store中看到工作样本,我会认为即时应用程序已经死了

打开游戏商店->选择应用->打开高级设置->添加发布类型即时应用

然后仅从即时应用上载即时应用选项:


谢谢您的解决方案。也许你可以把这个标记为可接受的答案?对我来说,当我尝试按描述部署时,会收到以下错误消息:“在创建即时应用程序发布之前,您应该发布您的应用程序”。你碰到它了吗?TnxI没有接受答案。请你把我的问题和答案向上投票:)也许你正试图从制作中上传它。你可以尝试使用内部测试上传它。我需要上传一次到“封闭测试”轨道,然后消息就消失了(也在内部)