Skip to content

Commit 273d2ae

Browse files
committed
Remove coreLibraryDesugaring dependency
1 parent 3411d3a commit 273d2ae

File tree

9 files changed

+215
-130
lines changed

9 files changed

+215
-130
lines changed

README.md

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ It is recommended to implement the `BillingConnector` instance in your MainActiv
2424

2525
This is necessary because sometimes (due to different reasons) the purchase is not instantly processed and will have a `PENDING` state. All `PENDING` state purchases cannot be `acknowledged` or `consumed` and **will be refunded** by Google after 3 days.
2626

27-
The library automatically handles acknowledgement and consumption, but for that, it needs the `BillingConnector` reference. It cannot happen in a background service. So if the `BillingConnector` is set in a remote activity that the user **rarely interacts with**, it will never receive the `Billing API callback` to update the purchase status and the user will lose the purchase.
27+
The library automatically handles acknowledgement and consumption, but for that, it needs the `BillingConnector` reference. It cannot happen in a background service. So if the `BillingConnector` is set in a remote activity that the user **rarely interacts with (or not at all)**, it will never receive the `Billing API callback` to acknowledge the new updated purchase status and the user will lose the purchase.
2828

2929
The library provides `ACKNOWLEDGE_WARNING` and `CONSUME_WARNING` error callbacks to let you know that the purchase status is still `PENDING`. Here you can inform the user to wait or to come back a little bit later to receive the purchase.
3030

@@ -91,7 +91,7 @@ allprojects {
9191

9292
```gradle
9393
dependencies {
94-
implementation 'com.github.moisoni97:google-inapp-billing:1.1.5'
94+
implementation 'com.github.moisoni97:google-inapp-billing:1.1.6'
9595
}
9696
```
9797

@@ -101,27 +101,6 @@ dependencies {
101101
<uses-permission android:name="com.android.vending.BILLING" />
102102
```
103103

104-
# Important Notice
105-
106-
* For builds that use `minSdkVersion` lower than `24` it is very important to include the following in your app's build.gradle file:
107-
108-
```gradle
109-
android {
110-
compileOptions {
111-
coreLibraryDesugaringEnabled true
112-
113-
sourceCompatibility JavaVersion.VERSION_17
114-
targetCompatibility JavaVersion.VERSION_17
115-
}
116-
}
117-
118-
dependencies {
119-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
120-
}
121-
```
122-
123-
This step is required to enable support for some APIs on lower SDK versions that aren't available natively only starting from `minSdkVersion 24`.
124-
125104
# Usage
126105

127106
* Create an instance of BillingConnector class. Constructor will take 3 parameters:

app/build.gradle

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ android {
1313
targetSdkVersion 36
1414

1515
versionCode 10
16-
versionName "1.1.5"
16+
versionName "1.1.6"
1717

1818
multiDexEnabled true
1919

@@ -27,15 +27,8 @@ android {
2727
}
2828
}
2929

30-
compileOptions {
31-
coreLibraryDesugaringEnabled true
32-
33-
sourceCompatibility JavaVersion.VERSION_17
34-
targetCompatibility JavaVersion.VERSION_17
35-
}
36-
3730
kotlinOptions {
38-
jvmTarget = "17"
31+
jvmTarget = "1.8"
3932
}
4033
}
4134

@@ -44,9 +37,7 @@ dependencies {
4437
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
4538
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
4639

47-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
48-
49-
implementation 'androidx.appcompat:appcompat:1.7.0'
40+
implementation 'androidx.appcompat:appcompat:1.7.1'
5041
implementation 'com.google.android.material:material:1.12.0'
5142
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
5243
implementation "org.jetbrains.kotlin:kotlin-stdlib"

app/src/main/java/games/moisoni/google_inapp_billing/SharedPrefsHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
import android.content.SharedPreferences;
66
import android.text.TextUtils;
77

8+
import androidx.annotation.NonNull;
9+
810
public final class SharedPrefsHelper {
911

1012
private static final String DEFAULT_SUFFIX = "_preferences";
1113
private static SharedPreferences mPrefs;
1214

13-
private static void initPrefs(Context context, String prefsName, int mode) {
15+
private static void initPrefs(@NonNull Context context, String prefsName, int mode) {
1416
mPrefs = context.getSharedPreferences(prefsName, mode);
1517
}
1618

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
}
88

99
dependencies {
10-
classpath 'com.android.tools.build:gradle:8.10.0'
10+
classpath 'com.android.tools.build:gradle:8.11.0'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22"
1212

1313
// NOTE: Do not place your application dependencies here; they belong

google-iab/build.gradle

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ android {
2626
}
2727
}
2828

29-
compileOptions {
30-
coreLibraryDesugaringEnabled true
31-
32-
sourceCompatibility JavaVersion.VERSION_17
33-
targetCompatibility JavaVersion.VERSION_17
34-
}
35-
3629
publishing {
3730
singleVariant("release") {
3831
withSourcesJar()
@@ -54,7 +47,7 @@ afterEvaluate {
5447
from components.release
5548
groupId = 'com.github.moisoni97'
5649
artifactId = 'google-inapp-billing'
57-
version = '1.1.5'
50+
version = '1.1.6'
5851
}
5952
}
6053
}
@@ -65,11 +58,9 @@ dependencies {
6558
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
6659
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
6760

68-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
69-
70-
implementation 'androidx.appcompat:appcompat:1.7.0'
61+
implementation 'androidx.appcompat:appcompat:1.7.1'
7162
implementation 'com.google.android.material:material:1.12.0'
72-
implementation 'com.google.guava:guava:33.3.1-android'
63+
implementation 'com.google.guava:guava:33.4.8-android'
7364

7465
implementation 'com.android.billingclient:billing:7.1.1'
7566
}

0 commit comments

Comments
 (0)