airsdk / ANE-PlayAssetDelivery

Play Asset Delivery ANE
2 stars 2 forks source link

fetchAssetPack / getAssetPackStatus / getAssetPackLocation causes released ver. app frozen #6

Closed jimmymjing closed 2 years ago

jimmymjing commented 2 years ago

@marchbold @ajwfrost Hello, I found a really strange bug. When I packaged aab file with adt -target aab-debug with local-testing, everything works fine.

Then I created a new release for Internal testing on Google Play's console, I packaged the aab file with adt -target aab and uploaded it.

And then I downloaded it from Play Store, but calling either fetchAssetPack or getAssetPackStatus or getAssetPackLocation would cause my app to freeze. I have called initAssetDelivery before calling these 3 functions. initAssetDelivery didn't freeze the app.

Here's the logs from the logcat:

12-30 08:33:59.524 I/PlayCore(28795): UID: [10383]  PID: [28795] AssetPackServiceImpl : syncPacks
12-30 08:33:59.524 I/PlayCore(28795): UID: [10383]  PID: [28795] AssetPackServiceImpl : syncPacks
12-30 08:33:59.525 I/PlayCore(28795): UID: [10383]  PID: [28795] AssetPackServiceImpl : startDownload([ap_assets_one])
12-30 08:33:59.526 I/PlayCore(28795): UID: [10383]  PID: [28795] AssetPackServiceImpl : Initiate binding to the service.
12-30 08:33:59.530 I/PlayCore(28795): UID: [10383]  PID: [28795] AssetPackServiceImpl : Waiting to bind to the service.
12-30 08:34:02.984 I/com.voxverbi.b(28795): Waiting for a blocking GC ProfileSaver
12-30 08:34:02.996 I/com.voxverbi.b(28795): WaitForGcToComplete blocked RunEmptyCheckpoint on ProfileSaver for 8.364ms
12-30 08:34:20.331 I/com.voxverbi.b(28795): Wrote stack traces to tombstoned
12-30 08:34:20.331 I/com.voxverbi.b(28795): Wrote stack traces to tombstoned
12-30 08:34:28.014 W/FirebaseInstanceId(28795): Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval

Here's the full log file: play store_2021_12_30_16_34_40.log

ps. Both ”on-demand” and ”fast-follow” are tried and the result is the same. I also tested on multiple devices (google pixel, Samsung..) in different countries. (Just to eliminate the factor of China manufactured devices)

I think the adt command is correct as the debug version works fine. Here's the ant script for packaging:

<target name="package-aab">
        <delete file="${output.dir}/Bf_android.aab"/>
        <exec executable="${air.adt}" failonerror="true">
            <arg line="-package"/>
            <arg line="-target aab"/>
            <arg line="-storetype PKCS12"/>
            <arg line="-keystore /Users/mingjing/Development/Biofanta/certi/inUse/voxAndroidCerti.p12"/>
            <arg line="-storepass ${password}"/>
            <arg line="${output.dir}/Bf_android.aab"/>
            <arg line="${output.dir}/Bf-android.xml"/>
            <arg line="-C ${output.dir} Bf_Android.swf"/>
            <arg line="-C ${basedir} assets"/>
            <arg line="-extdir /Users/mingjing/Development/Biofanta/DigitalStrewberryAnes"/>
            <arg line="-extdir /Users/mingjing/Development/Biofanta/Biofanta_dependency"/>
            <arg line="-extdir ${basedir}/ane"/>
            <arg line="-C ${source.dir}/res ."/>
            <arg line="-C ${basedir}/InitAssets ."/>
        </exec>
    </target>

Here's how the App bundle looks in Google Play console: Screen Shot 2021-12-29 at 4 47 29 PM Screen Shot 2021-12-29 at 4 49 24 PM

jimmymjing commented 2 years ago

@marchbold @ajwfrost Please help...

marchbold commented 2 years ago

(Will leave this one for Harman as we aren't involved in the development of this extension)

jimmymjing commented 2 years ago

(Will leave this one for Harman as we aren't involved in the development of this extension)

Thanks for your reply! May I ask if you have successfully downloaded on-demand / fast-forward Asset Packs on an installed app from Google Play?

marchbold commented 2 years ago

We haven't released an app using this functionality as yet so I'm probably not the best to ask about it. I've created the apm package and manage this repository for the publishing of the extension, but I'm yet to implement it in one of our apps.

jimmymjing commented 2 years ago

Thanks so much! I really appreciate all the work put into the development of apm and all the ANEs you have provided. Now this AssetPackDelivery is just killing me... Can't imagine I'm the only one fighting on this.

ajwfrost commented 2 years ago

Hi - I believe we've had other folk use this without a problem although I don't know for certain what types of asset packs they're using. But from the log I'm wondering, did you have the additional entries added to your application descriptor file, in the manifest additions?

    <application android:enabled="true">
        <activity
            android:name="com.google.android.play.core.common.PlayCoreDialogWrapperActivity"
            android:enabled="false"
            android:exported="false"
            android:stateNotNeeded="true" />
        <service
            android:name="com.google.android.play.core.assetpacks.AssetPackExtractionService"
            android:enabled="false"
            android:exported="true" />
        <service
            android:name="com.google.android.play.core.assetpacks.ExtractionForegroundService"
            android:enabled="false"
            android:exported="false" />
    </application>

thanks

jimmymjing commented 2 years ago

Thanks so much for pointing it out! I will double check it. As I'm relying on apm, so I assumed that these got inserted automatically...

ajwfrost commented 2 years ago

Ah, interesting, @marchbold do you think there could be a way to set up a package whereby APM automatically injects required elements like this into the app descriptor file?

jimmymjing commented 2 years ago

Here's my manifest additions. I think it's about the same. Do I miss anything important?

  <application>

    <!-- The activities will be merged into the manifest of the hosting app. -->
    <activity android:name="com.google.android.play.core.missingsplits.PlayCoreMissingSplitsActivity" 
android:enabled="false" android:exported="false" 
android:launchMode="singleInstance" android:process=":playcore_missing_splits_activity" 
android:stateNotNeeded="true"/>
    <activity android:name="com.google.android.play.core.common.PlayCoreDialogWrapperActivity" 
android:exported="false" 
android:stateNotNeeded="true" 
android:theme="@style/Theme.PlayCore.Transparent"/>
    <!-- The services will be merged into the manifest of the hosting app. -->
    <service android:name="com.google.android.play.core.assetpacks.AssetPackExtractionService" 
android:enabled="false" 
android:exported="true">
      <meta-data android:name="com.google.android.play.core.assetpacks.versionCode" android:value="11001"/>
    </service>
    <service android:name="com.google.android.play.core.assetpacks.ExtractionForegroundService" android:enabled="false" android:exported="false"/>
  </application>
jimmymjing commented 2 years ago

Sorry, it's still not working. I changed the manifest additions to yours play store_2022_1_7_18_33_36.log .

marchbold commented 2 years ago

These should already be added automatically via APM if you use the generate app descriptor command.

jimmymjing commented 2 years ago

Yes. These are already added by apm. Still not working...

ajwfrost commented 2 years ago

Okay thanks @marchbold, that's impressive! @jimmymjing we'll investigate further here on why it's not working, thanks for the log file...

jimmymjing commented 2 years ago

Thanks so much! FYI, both "internal app sharing" and "internal testing" on Google Play Console have been tried, and the result is the same.