Skip to content

Commit 8d2d2f2

Browse files
committed
Fix build errors due to library and tool updates
-. Minimal changes to maintain compatibility with Android Studio 4.x
1 parent b73385b commit 8d2d2f2

4 files changed

Lines changed: 24 additions & 11 deletions

File tree

PlayAssetDelivery/NativeSample/Teapot/build.gradle

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
apply plugin: 'com.android.application'
1919

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

2323
android {
24-
compileSdkVersion 28
24+
compileSdkVersion 34
2525

2626
defaultConfig {
2727
applicationId = 'com.google.android.samples.playassetdeliverynative'
28-
minSdkVersion 16
28+
minSdkVersion 21
2929
targetSdkVersion 28
3030
versionCode 1
3131
versionName "1.0.0"
@@ -42,8 +42,8 @@ android {
4242
release {
4343
minifyEnabled false
4444
proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
45-
proguardFile "$PLAY_CORE_NATIVE_SDK_DIR/proguard/asset_delivery.pgcfg"
46-
proguardFile "$PLAY_CORE_NATIVE_SDK_DIR/proguard/common.pgcfg"
45+
//proguardFile "$PLAY_CORE_NATIVE_SDK_DIR/proguard/asset_delivery.pgcfg"
46+
//proguardFile "$PLAY_CORE_NATIVE_SDK_DIR/proguard/common.pgcfg"
4747
}
4848
debug {
4949
minifyEnabled false
@@ -55,6 +55,11 @@ android {
5555
}
5656
}
5757

58+
compileOptions {
59+
sourceCompatibility JavaVersion.VERSION_1_8
60+
targetCompatibility JavaVersion.VERSION_1_8
61+
}
62+
5863
//All asset packs listed here will be included in the final AppBundle
5964
assetPacks = [":install_time_pack", ":on_demand_pack", ":fast_follow_pack"]
6065

@@ -64,7 +69,14 @@ android {
6469
}
6570

6671
dependencies {
72+
// This dependency is downloaded from the Google's Maven repository.
73+
// So, make sure you also include that repository in your project's build.gradle file.
74+
implementation 'com.google.android.play:asset-delivery:2.3.0'
75+
76+
// For Kotlin users also add the Kotlin extensions library for Play Asset Delivery:
77+
implementation 'com.google.android.play:asset-delivery-ktx:2.3.0'
78+
6779
implementation 'androidx.appcompat:appcompat:1.0.2'
6880
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
69-
implementation files("$PLAY_CORE_NATIVE_SDK_DIR/playcore.aar")
81+
//implementation files("$PLAY_CORE_NATIVE_SDK_DIR/playcore.aar")
7082
}

PlayAssetDelivery/NativeSample/Teapot/src/main/cpp/PlayAssetDeliveryUtil.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ AssetPackDownloadStatus PrintDownloadState(struct android_app *app) {
223223
*/
224224
void ShowCellularDataConfirmation(struct android_app *app) {
225225
AssetPackErrorCode error_code1 =
226-
AssetPackManager_showCellularDataConfirmation(app->activity->clazz);
227-
ShowCellularDataConfirmationStatus status;
226+
AssetPackManager_showConfirmationDialog(app->activity->clazz);
227+
ShowConfirmationDialogStatus status;
228228
AssetPackErrorCode error_code2 =
229-
AssetPackManager_getShowCellularDataConfirmationStatus(&status);
229+
AssetPackManager_getShowConfirmationDialogStatus(&status);
230230
char log[1000] = "";
231231
sprintf(log,
232232
"ShowCellularDataConfirmation, error_code=%d; Cellular data confirmation status=%d, error_code=%d",

PlayAssetDelivery/NativeSample/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ buildscript {
2121
jcenter()
2222
}
2323
dependencies {
24-
classpath 'com.android.tools.build:gradle:4.0.0-beta03'
24+
classpath 'com.android.tools.build:gradle:4.0.2'
2525
}
2626
}
2727

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Wed Jan 07 10:37:12 SGT 2026
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip

0 commit comments

Comments
 (0)