Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
163 views
in Technique[技术] by (71.8m points)

android - Instant app, Try Now button does not appear in play store

i started with following github projects but these example are not working properly. I added missing parts as stated in the docs. https://github.com/android/app-bundle-samples/tree/main/InstantApps/urlless https://github.com/googlecodelabs/android-dynamic-features

Here is the docs i read. 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

i try to implement a simple hello world instant app. I tried many things but try now button never appears in play store.

my app contains 2 module:

  • app
  • instant-app

build.gradle of app module :

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 of my instant-app module

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 of my app module

<?xml version="1.0" encoding="utf-8"?>
<manifest >

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

    ...

</manifest>

AndroidManifest.xml of my instant-app module

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

I generate a signed bundle and upload it in internal test in each of my try but it did not work. i tried it in prod environment too. Not work!

I tried to put applicationId "com.test.myapp" in both app module and instant-app module. I tried to made android:targetSandboxVersion="2" and android:targetSandboxVersion="1". Not work . Version code of my app is greater than version code of my instant-app as shown below.

I removed clearTextTraffic and added. Not work!

Some said me to take my instant app enabled code to take into production and upload a new upgraded instant app version. I did it, it did not work either.

I tried many many combinations which i cannot remember now. But try now button never appears. What is the missing part i cannot find ?

There are 3 different sayings for maximum size of instant-app module:

  • 4 mb
  • 10 mb
  • 15 mb Why the source codes and docs are conflicting too much and there is no working code in github ? If i didn't see working samples in play store, i would think instant apps are dead.
question from:https://stackoverflow.com/questions/65918686/instant-app-try-now-button-does-not-appear-in-play-store

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...