Skip to content

Commit 47c8494

Browse files
authored
Merge pull request #1497 from OneSignal/example/update_to_latest_versions
Update example project to latest Android dependencies; Gradle 7, AGP 7, etc
2 parents 2622c79 + cd89818 commit 47c8494

File tree

7 files changed

+236
-168
lines changed

7 files changed

+236
-168
lines changed

Examples/OneSignalDemo/app/build.gradle

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -53,35 +53,32 @@ android {
5353
}
5454

5555
dependencies {
56-
implementation fileTree(dir: 'libs', include: ['*.jar'])
57-
5856
implementation 'com.android.support:multidex:1.0.3'
59-
implementation 'com.google.android.material:material:[1.0.0, 1.4.99]'
57+
implementation 'com.google.android.material:material:1.4.0'
58+
implementation 'androidx.cardview:cardview:1.0.0'
59+
implementation 'androidx.appcompat:appcompat:1.4.0'
60+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
61+
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
6062

61-
implementation 'androidx.cardview:cardview:[1.0.0, 1.99.99]'
62-
implementation 'androidx.appcompat:appcompat:[1.0.0, 1.99.99]'
63-
implementation 'androidx.legacy:legacy-support-v4:[1.0.0, 1.99.99]'
64-
implementation 'androidx.vectordrawable:vectordrawable:[1.0.0, 1.99.99]'
65-
// Test public release OneSignal SDK
66-
// This will not work until 4.0.0 is publicly released because of manifest placeholders causing
67-
// manifest merger conflicts
68-
// implementation 'com.onesignal:OneSignal:3.12.6'
63+
implementation 'com.google.android.gms:play-services-location:18.0.0'
6964

70-
implementation 'com.google.android.gms:play-services-location:[17.0.0, 17.99.99]'
71-
// glide:4.9.0 is the last version before going to AndroidX
72-
// glide:4.10.0 is the first version using AndroidX
73-
implementation 'com.github.bumptech.glide:glide:[4.10.0, 4.99.99]'
74-
75-
// Test local OneSignal SDK
76-
gmsImplementation(project(':onesignal'))
65+
implementation 'com.github.bumptech.glide:glide:4.12.0'
7766

78-
huaweiImplementation 'com.huawei.hms:push:5.3.0.304'
79-
huaweiImplementation 'com.huawei.hms:location:4.0.0.300'
67+
/** START - Google Play Builds **/
68+
gmsImplementation('com.onesignal:OneSignal:4.6.3')
69+
/** END - Google Play Builds **/
70+
71+
/** START - Huawei Builds **/
8072
// Omit Google / Firebase libraries for Huawei builds.
81-
huaweiImplementation(project(':onesignal')) {
73+
huaweiImplementation('com.onesignal:OneSignal:4.6.3') {
8274
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
8375
exclude group: 'com.google.android.gms', module: 'play-services-analytics'
8476
exclude group: 'com.google.android.gms', module: 'play-services-location'
8577
exclude group: 'com.google.firebase', module: 'firebase-messaging'
8678
}
87-
}
79+
// Add HMS Push library
80+
huaweiImplementation 'com.huawei.hms:push:5.3.0.304'
81+
// Optionally add HMS location
82+
huaweiImplementation 'com.huawei.hms:location:4.0.0.300'
83+
/** END - Huawei Builds **/
84+
}

Examples/OneSignalDemo/build.gradle

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
buildscript {
44
repositories {
55
google()
6-
jcenter()
7-
maven { url 'https://plugins.gradle.org/m2/'}
8-
6+
mavenCentral()
7+
gradlePluginPortal()
8+
// Huawei maven
9+
maven { url 'https://developer.huawei.com/repo/' }
910
}
1011
dependencies {
11-
classpath 'com.android.tools.build:gradle:3.5.0'
12-
classpath 'com.google.gms:google-services:4.2.0'
13-
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.11.0, 0.99.99]'
12+
classpath 'com.android.tools.build:gradle:7.0.4'
13+
classpath 'com.google.gms:google-services:4.3.10'
14+
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.14.0, 0.99.99]'
15+
classpath 'com.huawei.agconnect:agcp:1.2.1.301'
1416

1517
// TODO: Do not place your application dependencies here; they belong
1618
// in the individual module build.gradle files
@@ -20,9 +22,9 @@ buildscript {
2022
allprojects {
2123
repositories {
2224
google()
23-
jcenter()
24-
maven { url 'https://maven.google.com' }
25-
25+
mavenCentral()
26+
// Huawei maven
27+
maven { url 'https://developer.huawei.com/repo/' }
2628
}
2729
}
2830

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
# Project-wide Gradle settings.
2-
# IDE (e.g. Android Studio) users:
3-
# Gradle settings configured through the IDE *will override*
4-
# any settings specified in this file.
5-
# For more details on how to configure your build environment visit
1+
## For more details on how to configure your build environment visit
62
# http://www.gradle.org/docs/current/userguide/build_environment.html
3+
#
74
# Specifies the JVM arguments used for the daemon process.
85
# The setting is particularly useful for tweaking memory settings.
9-
org.gradle.jvmargs=-Xmx1536m
6+
# Default value: -Xmx1024m -XX:MaxPermSize=256m
7+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
8+
#
109
# When configured, Gradle will run in incubating parallel mode.
1110
# This option should only be used with decoupled projects. More details, visit
1211
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1312
# org.gradle.parallel=true
13+
#Wed Dec 08 19:57:11 PST 2021
14+
org.gradle.jvmargs=-Xmx1536m
15+
android.useAndroidX=true
16+
android.enableJetifier=false
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Wed Sep 25 18:37:17 PDT 2019
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

0 commit comments

Comments
 (0)