Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions PlayAssetDelivery/NativeSample/Teapot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
apply plugin: 'com.android.application'

// Wrap the relative path with file() since CMake requires an absolute path.
def PLAY_CORE_NATIVE_SDK_DIR = file('../play-core-native-sdk')
// def PLAY_CORE_NATIVE_SDK_DIR = file('../play-core-native-sdk')

android {
compileSdkVersion 28
compileSdkVersion 34

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While you've correctly updated compileSdkVersion to 34, the targetSdkVersion on line 29 remains at 28. It is highly recommended to set targetSdkVersion to the same value as compileSdkVersion. Targeting a recent API level is a Google Play requirement for new apps and updates, and it ensures your app can leverage the latest platform features, security enhancements, and behavior changes. Failing to update it can lead to compatibility issues on newer Android devices.


defaultConfig {
applicationId = 'com.google.android.samples.playassetdeliverynative'
minSdkVersion 16
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
Expand All @@ -42,8 +42,8 @@ android {
release {
minifyEnabled false
proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
proguardFile "$PLAY_CORE_NATIVE_SDK_DIR/proguard/asset_delivery.pgcfg"
proguardFile "$PLAY_CORE_NATIVE_SDK_DIR/proguard/common.pgcfg"
//proguardFile "$PLAY_CORE_NATIVE_SDK_DIR/proguard/asset_delivery.pgcfg"
//proguardFile "$PLAY_CORE_NATIVE_SDK_DIR/proguard/common.pgcfg"
}
debug {
minifyEnabled false
Expand All @@ -55,6 +55,11 @@ android {
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

//All asset packs listed here will be included in the final AppBundle
assetPacks = [":install_time_pack", ":on_demand_pack", ":fast_follow_pack"]

Expand All @@ -64,7 +69,14 @@ android {
}

dependencies {
// This dependency is downloaded from the Google's Maven repository.
// So, make sure you also include that repository in your project's build.gradle file.
implementation 'com.google.android.play:asset-delivery:2.3.0'

// For Kotlin users also add the Kotlin extensions library for Play Asset Delivery:
implementation 'com.google.android.play:asset-delivery-ktx:2.3.0'

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation files("$PLAY_CORE_NATIVE_SDK_DIR/playcore.aar")
//implementation files("$PLAY_CORE_NATIVE_SDK_DIR/playcore.aar")
}
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ AssetPackDownloadStatus PrintDownloadState(struct android_app *app) {
*/
void ShowCellularDataConfirmation(struct android_app *app) {
AssetPackErrorCode error_code1 =
AssetPackManager_showCellularDataConfirmation(app->activity->clazz);
ShowCellularDataConfirmationStatus status;
AssetPackManager_showConfirmationDialog(app->activity->clazz);
ShowConfirmationDialogStatus status;
AssetPackErrorCode error_code2 =
AssetPackManager_getShowCellularDataConfirmationStatus(&status);
AssetPackManager_getShowConfirmationDialogStatus(&status);
Comment on lines 225 to +229

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

You've updated the code to use the newer AssetPackManager_showConfirmationDialog API, which is great. However, the containing function is still named ShowCellularDataConfirmation (line 224), and the log message on line 232 also refers to the old name. This creates an inconsistency that can be confusing for future maintenance. For better code clarity, I recommend renaming the function to ShowConfirmationDialog and updating the log message. This would also require updating the function declaration in PlayAssetDeliveryUtil.h and any places where it's called.

char log[1000] = "";
sprintf(log,
"ShowCellularDataConfirmation, error_code=%d; Cellular data confirmation status=%d, error_code=%d",
Expand Down
2 changes: 1 addition & 1 deletion PlayAssetDelivery/NativeSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0-beta03'
classpath 'com.android.tools.build:gradle:4.0.2'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Wed Jan 07 10:37:12 SGT 2026
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip
Loading