From 900aab2010c00c24f10480470315ee4e36771d0b Mon Sep 17 00:00:00 2001 From: raoxudong Date: Mon, 23 Nov 2020 11:47:45 +0800 Subject: [PATCH] fix bug --- .dart_tool/package_config.json | 30 +++-- .packages | 11 +- CHANGELOG.md | 2 + README.md | 2 +- .../java/com/jiguang/jpush/JPushPlugin.java | 6 + example/.flutter-plugins-dependencies | 2 +- .../ios/Flutter/flutter_export_environment.sh | 8 +- example/pubspec.lock | 111 ++++++++---------- pubspec.lock | 18 ++- pubspec.yaml | 2 +- 10 files changed, 103 insertions(+), 89 deletions(-) diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index b81d105..c75887a 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -25,6 +25,12 @@ "packageUri": "lib/", "languageVersion": "2.0" }, + { + "name": "characters", + "rootUri": "file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.1.0-nullsafety.3", + "packageUri": "lib/", + "languageVersion": "2.10" + }, { "name": "charcode", "rootUri": "file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.2", @@ -33,9 +39,9 @@ }, { "name": "collection", - "rootUri": "file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.11", + "rootUri": "file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0-nullsafety.3", "packageUri": "lib/", - "languageVersion": "2.0" + "languageVersion": "2.10" }, { "name": "convert", @@ -59,7 +65,7 @@ "name": "flutter", "rootUri": "file:///Applications/flutter/packages/flutter", "packageUri": "lib/", - "languageVersion": "2.2" + "languageVersion": "2.10" }, { "name": "front_end", @@ -123,9 +129,9 @@ }, { "name": "meta", - "rootUri": "file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.8", + "rootUri": "file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.3.0-nullsafety.3", "packageUri": "lib/", - "languageVersion": "1.12" + "languageVersion": "2.10" }, { "name": "mime", @@ -291,15 +297,15 @@ }, { "name": "typed_data", - "rootUri": "file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6", + "rootUri": "file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0-nullsafety.3", "packageUri": "lib/", - "languageVersion": "2.0" + "languageVersion": "2.10" }, { "name": "vector_math", - "rootUri": "file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8", + "rootUri": "file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.0-nullsafety.3", "packageUri": "lib/", - "languageVersion": "2.0" + "languageVersion": "2.10" }, { "name": "vm_service_lib", @@ -329,10 +335,10 @@ "name": "jpush_flutter", "rootUri": "../", "packageUri": "lib/", - "languageVersion": "2.0" + "languageVersion": "2.1" } ], - "generated": "2020-05-18T10:01:14.006528Z", + "generated": "2020-11-23T03:44:50.379322Z", "generator": "pub", - "generatorVersion": "2.7.2" + "generatorVersion": "2.10.4" } diff --git a/.packages b/.packages index 2d39d9a..4fc1b01 100644 --- a/.packages +++ b/.packages @@ -1,10 +1,11 @@ -# Generated by pub on 2020-05-18 18:01:13.982490. +# Generated by pub on 2020-11-23 11:44:50.345653. analyzer:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.37.0/lib/ args:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/args-1.5.2/lib/ async:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.3.0/lib/ boolean_selector:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-1.0.5/lib/ +characters:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/characters-1.1.0-nullsafety.3/lib/ charcode:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.2/lib/ -collection:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.11/lib/ +collection:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.15.0-nullsafety.3/lib/ convert:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1/lib/ crypto:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.0.6/lib/ csslib:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/csslib-0.16.1/lib/ @@ -19,7 +20,7 @@ io:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/io-0.3.3/lib js:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/js-0.6.1+1/lib/ kernel:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/kernel-0.3.20/lib/ matcher:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.5/lib/ -meta:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.8/lib/ +meta:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.3.0-nullsafety.3/lib/ mime:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/mime-0.9.6+3/lib/ mockito:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/mockito-3.0.2/lib/ multi_server_socket:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/multi_server_socket-1.0.2/lib/ @@ -47,8 +48,8 @@ term_glyph:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/term test:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/test-1.6.5/lib/ test_api:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.6/lib/ test_core:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_core-0.2.7/lib/ -typed_data:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6/lib/ -vector_math:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8/lib/ +typed_data:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.3.0-nullsafety.3/lib/ +vector_math:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.1.0-nullsafety.3/lib/ vm_service_lib:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/vm_service_lib-3.22.2/lib/ watcher:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/watcher-0.9.7+12/lib/ web_socket_channel:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/web_socket_channel-1.0.14/lib/ diff --git a/CHANGELOG.md b/CHANGELOG.md index c841d6e..8349a2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.6.1 ++ 修复:Android 端 context为空时的crash问题 ## 0.6.0 + 修复:修复已知bug ## 0.5.9 diff --git a/README.md b/README.md index 3c43330..0133324 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ dependencies: // pub 集成 dependencies: - jpush_flutter: 0.6.0 + jpush_flutter: 0.6.1 ``` ### 配置 diff --git a/android/src/main/java/com/jiguang/jpush/JPushPlugin.java b/android/src/main/java/com/jiguang/jpush/JPushPlugin.java index 2edaf71..895d98f 100644 --- a/android/src/main/java/com/jiguang/jpush/JPushPlugin.java +++ b/android/src/main/java/com/jiguang/jpush/JPushPlugin.java @@ -166,6 +166,12 @@ public class JPushPlugin implements MethodCallHandler { } openNotificationCacheList.removeAll(tempList); } + + if (registrar == null || registrar.context() == null) { + Log.d(TAG,"scheduleCache,register context is nil."); + return; + } + String rid = JPushInterface.getRegistrationID(registrar.context()); boolean ridAvailable = rid != null && !rid.isEmpty(); if (ridAvailable && dartIsReady) { diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index 564fcf4..57e9719 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"jpush_flutter","dependencies":[]}]} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"jpush_flutter","path":"/Users/raoxudong/JPush/jpush-github/jpush-flutter-plugin/","dependencies":[]}],"android":[{"name":"jpush_flutter","path":"/Users/raoxudong/JPush/jpush-github/jpush-flutter-plugin/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"jpush_flutter","dependencies":[]}],"date_created":"2020-11-23 11:44:53.035209","version":"1.22.4"} \ No newline at end of file diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh index d7849cc..a0dea41 100755 --- a/example/ios/Flutter/flutter_export_environment.sh +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -2,10 +2,14 @@ # This is a generated file; do not edit or check into version control. export "FLUTTER_ROOT=/Applications/flutter" export "FLUTTER_APPLICATION_PATH=/Users/raoxudong/JPush/jpush-github/jpush-flutter-plugin/example" -export "FLUTTER_TARGET=/Users/raoxudong/JPush/jpush-github/jpush-flutter-plugin/example/lib/main.dart" +export "FLUTTER_TARGET=lib/main.dart" export "FLUTTER_BUILD_DIR=build" export "SYMROOT=${SOURCE_ROOT}/../build/ios" +export "OTHER_LDFLAGS=$(inherited) -framework Flutter" export "FLUTTER_FRAMEWORK_DIR=/Applications/flutter/bin/cache/artifacts/engine/ios" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" -export "TRACK_WIDGET_CREATION=true" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=false" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.packages" diff --git a/example/pubspec.lock b/example/pubspec.lock index 8c75d99..0326117 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -15,13 +15,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.39.8" - archive: - dependency: transitive - description: - name: archive - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.11" args: dependency: transitive description: @@ -35,28 +28,42 @@ packages: name: async url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.0" + version: "2.5.0-nullsafety.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.5" + version: "2.1.0-nullsafety.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: name: charcode url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.2" + version: "1.2.0-nullsafety.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0-nullsafety.1" collection: dependency: transitive description: name: collection url: "https://pub.flutter-io.cn" source: hosted - version: "1.14.11" + version: "1.15.0-nullsafety.3" convert: dependency: transitive description: @@ -92,6 +99,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.1.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.0-nullsafety.1" flutter: dependency: "direct main" description: flutter @@ -137,13 +151,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "3.1.4" - image: - dependency: transitive - description: - name: image - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.4" io: dependency: transitive description: @@ -157,14 +164,14 @@ packages: path: ".." relative: true source: path - version: "0.5.6" + version: "0.6.1" js: dependency: transitive description: name: js url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.1+1" + version: "0.6.3-nullsafety.2" logging: dependency: transitive description: @@ -178,14 +185,14 @@ packages: name: matcher url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.6" + version: "0.12.10-nullsafety.1" meta: dependency: transitive description: name: meta url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.8" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -200,13 +207,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" - multi_server_socket: - dependency: transitive - description: - name: multi_server_socket - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.0.2" node_interop: dependency: transitive description: @@ -248,21 +248,14 @@ packages: name: path url: "https://pub.flutter-io.cn" source: hosted - version: "1.6.4" + version: "1.8.0-nullsafety.1" pedantic: dependency: transitive description: name: pedantic url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.0+1" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.4.0" + version: "1.10.0-nullsafety.2" platform: dependency: transitive description: @@ -276,7 +269,7 @@ packages: name: pool url: "https://pub.flutter-io.cn" source: hosted - version: "1.4.0" + version: "1.5.0-nullsafety.2" pub_semver: dependency: transitive description: @@ -284,13 +277,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.4.4" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.5" shelf: dependency: transitive description: @@ -330,84 +316,84 @@ packages: name: source_map_stack_trace url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.5" + version: "2.1.0-nullsafety.3" source_maps: dependency: transitive description: name: source_maps url: "https://pub.flutter-io.cn" source: hosted - version: "0.10.9" + version: "0.10.10-nullsafety.2" source_span: dependency: transitive description: name: source_span url: "https://pub.flutter-io.cn" source: hosted - version: "1.5.5" + version: "1.8.0-nullsafety.2" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.flutter-io.cn" source: hosted - version: "1.9.3" + version: "1.10.0-nullsafety.1" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.1.0-nullsafety.1" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.5" + version: "1.1.0-nullsafety.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.0" + version: "1.2.0-nullsafety.1" test: dependency: "direct dev" description: name: test url: "https://pub.flutter-io.cn" source: hosted - version: "1.9.4" + version: "1.16.0-nullsafety.5" test_api: dependency: transitive description: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.11" + version: "0.2.19-nullsafety.2" test_core: dependency: transitive description: name: test_core url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.15" + version: "0.3.12-nullsafety.5" typed_data: dependency: transitive description: name: typed_data url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.6" + version: "1.3.0-nullsafety.3" vector_math: dependency: transitive description: name: vector_math url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.8" + version: "2.1.0-nullsafety.3" vm_service: dependency: transitive description: @@ -429,13 +415,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" - xml: + webkit_inspection_protocol: dependency: transitive description: - name: xml + name: webkit_inspection_protocol url: "https://pub.flutter-io.cn" source: hosted - version: "3.5.0" + version: "0.7.4" yaml: dependency: transitive description: @@ -444,4 +430,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.7.0 <3.0.0" + dart: ">=2.10.0-110 <2.11.0" + flutter: ">=1.10.0" diff --git a/pubspec.lock b/pubspec.lock index 7468c9f..9fc8a6a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -29,6 +29,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.5" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: @@ -42,7 +49,7 @@ packages: name: collection url: "https://pub.flutter-io.cn" source: hosted - version: "1.14.11" + version: "1.15.0-nullsafety.3" convert: dependency: transitive description: @@ -145,7 +152,7 @@ packages: name: meta url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.8" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -339,14 +346,14 @@ packages: name: typed_data url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.6" + version: "1.3.0-nullsafety.3" vector_math: dependency: transitive description: name: vector_math url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.8" + version: "2.1.0-nullsafety.3" vm_service_lib: dependency: transitive description: @@ -376,4 +383,5 @@ packages: source: hosted version: "2.1.16" sdks: - dart: ">=2.2.2 <3.0.0" + dart: ">=2.10.0-110 <2.11.0" + flutter: ">=1.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index adb1b31..fc8927e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: jpush_flutter description: JIGUANG officially supported JPush Flutter plugin (Android & iOS). 极光推送官方支持的 Flutter 插件(Android & iOS)(https://www.jiguang.cn). -version: 0.6.0 +version: 0.6.1 # author: xudong.rao homepage: https://www.jiguang.cn