diefferson / http_certificate_pinning

Https Certificate pinning for Flutter
Apache License 2.0
83 stars 70 forks source link

Error: The getter 'Platform' isn't defined for the class 'CertificatePinningInterceptor'. #18

Closed stevanusw28 closed 2 years ago

stevanusw28 commented 2 years ago

After updating to version 2.0.1, the application got this error:

Downloading android-arm-profile/linux-x64 tools... 240ms Downloading android-arm-release/linux-x64 tools... 93ms Downloading android-arm64-profile/linux-x64 tools... 96ms Downloading android-arm64-release/linux-x64 tools... 74ms Downloading android-x64-profile/linux-x64 tools... 77ms Downloading android-x64-release/linux-x64 tools... 63ms

Building without sound null safety For more information see https://dart.dev/null-safety/unsound-null-safety

Running Gradle task 'assembleRelease'...
Checking the license for package Android SDK Build-Tools 28.0.3 in /opt/android-sdk-linux/licenses License for package Android SDK Build-Tools 28.0.3 accepted. Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)". "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" ready. Installing Android SDK Build-Tools 28.0.3 in /opt/android-sdk-linux/build-tools/28.0.3 "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" complete. "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" finished. Checking the license for package Android SDK Platform 29 in /opt/android-sdk-linux/licenses License for package Android SDK Platform 29 accepted. Preparing "Install Android SDK Platform 29 (revision: 5)". "Install Android SDK Platform 29 (revision: 5)" ready. Installing Android SDK Platform 29 in /opt/android-sdk-linux/platforms/android-29 "Install Android SDK Platform 29 (revision: 5)" complete. "Install Android SDK Platform 29 (revision: 5)" finished. Checking the license for package Android SDK Platform 28 in /opt/android-sdk-linux/licenses License for package Android SDK Platform 28 accepted. Preparing "Install Android SDK Platform 28 (revision: 6)". "Install Android SDK Platform 28 (revision: 6)" ready. Installing Android SDK Platform 28 in /opt/android-sdk-linux/platforms/android-28 "Install Android SDK Platform 28 (revision: 6)" complete. "Install Android SDK Platform 28 (revision: 6)" finished. Checking the license for package Android SDK Platform 31 in /opt/android-sdk-linux/licenses License for package Android SDK Platform 31 accepted. Preparing "Install Android SDK Platform 31 (revision: 1)". "Install Android SDK Platform 31 (revision: 1)" ready. Installing Android SDK Platform 31 in /opt/android-sdk-linux/platforms/android-31 "Install Android SDK Platform 31 (revision: 1)" complete. "Install Android SDK Platform 31 (revision: 1)" finished. ../.pub-cache/hosted/pub.dartlang.org/http_certificate_pinning-2.0.1/lib/src/dio/certificate_pinning_interceptor.dart:34:11: Error: The getter 'Platform' isn't defined for the class 'CertificatePinningInterceptor'.

  • 'CertificatePinningInterceptor' is from 'package:http_certificate_pinning/src/dio/certificate_pinning_interceptor.dart' ('../.pub-cache/hosted/pub.dartlang.org/http_certificate_pinning-2.0.1/lib/src/dio/certificate_pinning_interceptor.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'Platform'. if (Platform.isIOS && secure != null) { ^^^^^^^^

FAILURE: Build failed with an exception.

  • Where: Script '/sdks/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1005

  • What went wrong: Execution failed for task ':flutter:compileFlutterBuildRelease'.

    Process 'command '/sdks/flutter/bin/flutter'' finished with non-zero exit value 1

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2m 6s Running Gradle task 'assembleRelease'... 126.6s Gradle task assembleRelease failed with exit code 1

Exited with code exit status 1

Please check, thank you @diefferson

diefferson commented 2 years ago

Fixed.

hongquanvn1998 commented 2 years ago

How can i fix it ? I running my project and get the same issue. please help me