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 it's great that you've updated compileSdkVersion to 34, the targetSdkVersion is still set to 28 (on line 29). This is very outdated and does not meet current Google Play requirements, which mandate targeting a recent API level (e.g., 33 or higher). To ensure your app is compliant and can leverage the latest platform improvements, you should also update targetSdkVersion to 34 to match compileSdkVersion.


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'

Choose a reason for hiding this comment

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

medium

This dependency adds the Kotlin extensions library for Play Asset Delivery. However, this project doesn't appear to use Kotlin (e.g., TeapotNativeActivity.java is a Java file, and the kotlin-android plugin isn't applied). To keep the app lightweight and avoid unused dependencies, it's recommended to remove this line.


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 +226 to +229

Choose a reason for hiding this comment

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

medium

The API calls here have been updated from ...showCellularDataConfirmation... to the more generic ...showConfirmationDialog.... However, the enclosing function is still named ShowCellularDataConfirmation (line 224), and the log message on line 232 also uses this old name. This creates a mismatch and can be confusing. For better code clarity and maintainability, consider renaming the function to ShowConfirmationDialog and updating the log message accordingly. This would also require updating the function declaration in PlayAssetDeliveryUtil.h and any call sites.

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'

Choose a reason for hiding this comment

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

high

While updating the Android Gradle Plugin, it's a critical time to also address the use of jcenter() (line 21). JCenter has been sunset and is no longer a reliable repository, which can lead to build failures. Please replace jcenter() with mavenCentral() in both the buildscript and allprojects repository blocks to ensure future build stability.

}
}

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