Skip to content

Commit 588c063

Browse files
committed
Updating for 1.0.4
* bumped tooling versions to latest * handled cancelled and other onActivityResult() return codes that cause NPE. * Depend on latest Play Services Auth library. Change-Id: Ib783e6943800d86d5a13aafd6dc86bdea601b0ab
1 parent 9faa90f commit 588c063

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

Diff for: GoogleSignInPlugin/Assets/GoogleSignIn/Editor/GoogleSignInDependencies.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- See https://github.com/googlesamples/unity-jar-resolver#usage for
44
how to configure dependencies -->
55
<androidPackages>
6-
<androidPackage spec="com.google.android.gms:play-services-auth:10+">
6+
<androidPackage spec="com.google.android.gms:play-services-auth:16+">
77
<androidSdkPackageIds>
88
<androidSdkPackageId>extra-google-m2repository</androidSdkPackageId>
99
</androidSdkPackageIds>

Diff for: build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ import groovy.io.FileType
1919

2020
buildscript {
2121
repositories {
22+
google()
2223
jcenter()
2324
}
2425
dependencies {
25-
classpath 'com.android.tools.build:gradle:2.3.3'
26+
classpath 'com.android.tools.build:gradle:3.1.4'
2627

2728
// NOTE: Do not place your application dependencies here; they belong
2829
// in the individual module build.gradle files
@@ -31,6 +32,7 @@ buildscript {
3132

3233
allprojects {
3334
repositories {
35+
google()
3436
jcenter()
3537
}
3638
}
@@ -66,7 +68,7 @@ project.ext {
6668
git_exe = 'git'
6769
}
6870

69-
pluginVersion = "1.0.3"
71+
pluginVersion = "1.0.4"
7072
currentPluginBasename = 'google-signin-plugin'
7173
currentPluginName = (currentPluginBasename + '-' + pluginVersion +
7274
'.unitypackage')

Diff for: gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Diff for: native-googlesignin/build.gradle

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ project.ext.baseName = "google-signin-support"
3333

3434
android {
3535
compileSdkVersion 26
36-
buildToolsVersion "26.0.3"
3736
defaultConfig {
3837
minSdkVersion 14
3938
targetSdkVersion 26
@@ -45,7 +44,7 @@ android {
4544
}
4645
}
4746
ndk {
48-
abiFilters 'x86', 'armeabi-v7a'
47+
abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
4948
}
5049
}
5150
lintOptions {
@@ -113,5 +112,5 @@ uploadArchives {
113112
}
114113

115114
dependencies {
116-
compile "com.google.android.gms:play-services-auth:10.2.6"
115+
api "com.google.android.gms:play-services-auth:16.0.0"
117116
}

Diff for: native-googlesignin/src/main/java/com/google/googlesignin/GoogleSignInFragment.java

+11-4
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ private void buildClient(TokenRequest request) {
412412
}
413413
}
414414
if (request.getHidePopups()) {
415-
View invisible = new View(getContext());
415+
View invisible = new View(getActivity());
416416
invisible.setVisibility(View.INVISIBLE);
417417
invisible.setClickable(false);
418418
clientBuilder.setViewForPopups(invisible);
@@ -456,7 +456,7 @@ private GoogleSignInOptionsExtension getGamesExtension() {
456456
setter.invoke(builder, false);
457457

458458
Method buildMethod = builder.getClass().getMethod("build");
459-
return (GoogleSignInOptionsExtension) builderMethod.invoke(builder);
459+
return (GoogleSignInOptionsExtension) buildMethod.invoke(builder);
460460

461461
} catch (ClassNotFoundException e) {
462462
throw new IllegalArgumentException(
@@ -526,8 +526,15 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
526526
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
527527
TokenRequest request = this.request;
528528
if (request != null) {
529-
GoogleSignInAccount acct = result.getSignInAccount();
530-
request.setResult(result.getStatus().getStatusCode(), acct);
529+
if (result == null) {
530+
// This usually indicates a problem with Google Play Services not working correctly.
531+
int returnCode = resultCode >= 0 ? CommonStatusCodes.ERROR : resultCode;
532+
request.setResult( returnCode, null);
533+
GoogleSignInHelper.logError("GoogleSignIn result is null, returning error.");
534+
} else {
535+
GoogleSignInAccount acct = result.getSignInAccount();
536+
request.setResult(result.getStatus().getStatusCode(), acct);
537+
}
531538
} else {
532539
GoogleSignInHelper.logError("Pending request is null, can't " + "return result!");
533540
}

0 commit comments

Comments
 (0)