Skip to content

Commit 83d469e

Browse files
Update PSPDFKit for Android to 6.5 (#66)
* Update to 6.5 and drop Maven password * Additional Gradle cleanup
1 parent 5f7a7ae commit 83d469e

File tree

6 files changed

+2
-63
lines changed

6 files changed

+2
-63
lines changed

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Let's create a simple app that integrates PSPDFKit and uses the Flutter pspdfkit
3434
```local.properties
3535
sdk.dir=/path/to/your/Android/sdk
3636
flutter.sdk=/path/to/your/flutter/sdk
37-
pspdfkit.password=YOUR_MAVEN_KEY_GOES_HERE
3837
flutter.buildMode=debug
3938
```
4039

@@ -398,17 +397,3 @@ The verbose mode of flutter doctor is even more helpful; it prints out extensive
398397
### CocoaPods Conflicts With Asdf
399398

400399
If [asdf](https://github.com/asdf-vm/asdf) is installed in your machine it might create problems when running Cocoapods, and Flutter will erroneusly suggest to install CocoaPods via brew with `brew install cocoapods`. This won't work because for this specific configuration CocoaPods needs to be installed via [RubyGems](https://rubygems.org/). To fix this configuration issue just type `gem install cocoapods && pod setup`.
401-
402-
## Error When Running on Android: Cannot Find Symbol `PSPDFKit`
403-
404-
Verify that your Maven key has been correctly inserted in your `myapp/android/local.properties`
405-
406-
```local.properties
407-
sdk.dir=/path/to/your/Android/sdk
408-
flutter.sdk=/path/to/your/flutter/sdk
409-
pspdfkit.password=YOUR_MAVEN_KEY_GOES_HERE
410-
flutter.buildMode=debug
411-
```
412-
413-
Make sure that the Maven key has not been confused with the license key. The Maven key is generally shorter and for demo licenses it starts with `TRIAL-`.
414-

android/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ Upon opening the Flutter example project for the first time inside Android Studi
1818
sdk.dir=/path/to/your/android/sdk
1919
ndk.dir=/path/to/your/android/sdk/ndk-bundle
2020
flutter.sdk=/path/to/your/flutter/sdk
21-
22-
pspdfkit.password=YOUR_PSPDFKIT_MAVEN_PASSWORD
2321
```
2422

25-
The `pspdfkit.password` should be set to the PSPDFKit Maven download credentials that you received while [requesting a PSPDFKit demo](https://pspdfkit.com/try) or from your [PSPDFKit customer portal](https://customers.pspdfkit.com).
26-
2723
## Troubleshooting
2824

2925
### Configuration on demand

android/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ rootProject.allprojects {
2626
repositories {
2727
maven {
2828
url pspdfkitMavenUrl
29-
credentials {
30-
username pspdfkitUsername
31-
password pspdfkitPassword
32-
}
3329
}
3430
google()
3531
jcenter()

android/config.gradle

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,12 @@ if (pspdfkitMavenUrl == null || pspdfkitMavenUrl == '') {
2424
ext.pspdfkitMavenUrl = 'https://customers.pspdfkit.com/maven/'
2525
}
2626

27-
ext.pspdfkitUsername = localProperties.getProperty('pspdfkit.username')
28-
if (pspdfkitUsername == null || pspdfkitUsername == '') {
29-
ext.pspdfkitUsername = 'pspdfkit'
30-
}
31-
32-
ext.pspdfkitPassword = localProperties.getProperty('pspdfkit.password')
33-
if (pspdfkitPassword == null || pspdfkitPassword == '') {
34-
throw new GradleException("PSPDFKit password was not specified. The password is required to download the PSPDFKit AAR file into your project. Please specify as pspdfkit.password inside the local.properties file.")
35-
}
36-
3727
ext.pspdfkitVersion = localProperties.getProperty('pspdfkit.version')
3828
if (pspdfkitVersion == null || pspdfkitVersion == '') {
39-
ext.pspdfkitVersion = '6.4.0'
40-
}
41-
42-
def pspdfkitIsDemo = localProperties.getProperty('pspdfkit.demo')
43-
if (pspdfkitIsDemo == null) {
44-
pspdfkitIsDemo = pspdfkitPassword.startsWith('TRIAL-')
45-
} else {
46-
pspdfkitIsDemo = Boolean.parseBoolean(pspdfkitIsDemo)
29+
ext.pspdfkitVersion = '6.5.0'
4730
}
4831

49-
ext.pspdfkitMavenModuleName = (pspdfkitIsDemo && !useUnifiedBinaries(ext.pspdfkitVersion)) ? 'pspdfkit-demo' : 'pspdfkit'
32+
ext.pspdfkitMavenModuleName = 'pspdfkit'
5033

5134
ext.pspdfkitFlutterVersion = '1.9.0-SNAPSHOT'
5235

@@ -55,19 +38,3 @@ ext.androidBuildToolsVersion = '29.0.1'
5538
ext.androidMinSdkVersion = 19
5639
ext.androidTargetSdkVersion = 29
5740
ext.androidGradlePluginVersion = '3.6.3'
58-
59-
// Returns true when version1 is more recent than or equals to version2.
60-
boolean isMoreRecentOrEqual(String version1, String version2) {
61-
[version1,version2]*.tokenize('.')*.collect { it as int }.with { u, v ->
62-
Integer result = [u,v].transpose().findResult{ x,y -> x <=> y ?: null } ?: u.size() <=> v.size()
63-
return (result == 1 || result == 0)
64-
}
65-
}
66-
67-
// Starting from version 5.5.0 we moved to a simplified model
68-
// that uses unified binaries when on trial and in production
69-
// https://pspdfkit.com/blog/2019/pspdfkit-android-5-5/#simplified-integration
70-
boolean useUnifiedBinaries(String version) {
71-
String versionUnified = '5.5.0'
72-
return isMoreRecentOrEqual(version, versionUnified)
73-
}

example/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ This is a brief example of how to use the PSPDFKit with Flutter.
1111
```local.properties
1212
sdk.dir=/path/to/your/Android/sdk
1313
flutter.sdk=/path/to/your/flutter/sdk
14-
pspdfkit.password=YOUR_PASSWORD_GOES_HERE
1514
flutter.buildMode=debug
1615
```
1716

example/android/local.properties.sample

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,3 @@ ndk.dir=/path/to/your/android/ndk
44
sdk.dir=/path/to/your/android/sdk
55
flutter.sdk=/path/to/your/flutter/sdk
66
flutter.buildMode=debug
7-
8-
# The Maven password you received while together with your PSPDFKit demo email, or your customer Maven password.
9-
# If you don't yet own a password, please head over to https://pspdfkit.com/try to request a demo.
10-
pspdfkit.password=

0 commit comments

Comments
 (0)