繁体   English   中英

带有颤振的传送带 - 在本地运行 .net Web 应用程序时出现握手错误

[英]Conveyor with Flutter - Handshake error when running .net web app locally

我正在使用Conveyor (一个 Visual Studio 2019 扩展)让我的 ASP.NET Core 可用于 android 模拟器。 到目前为止,这一直很有效。 我已经开发了 Xamarin 应用程序、UWP 应用程序,并且之前将它用于本机 Android 应用程序,它可以正常工作。 但是在当前的 flutter 应用程序中,这不起作用。

Conveyor 确实提供了在 android 设备上安装证书的教程: https : //conveyor.cloud/Help/SSL

按照这些说明操作后,我可以正常加载网页:

有效证书安卓模拟器

这也已在 Windows(运行 Web 应用程序的机器)上完成,但这是由 Conveyor 扩展自动完成的,但是:

颁发的证书

我运行此 Dart 代码来调用 API:

未来登录(字符串电子邮件,字符串密码)异步{

var response = await http
    .post("$_url/login", body: {email: email, password: password});//_url= https://192.168.0.148:45455/api

if (response.statusCode == 200) {
  var token = LoginResult.fromJson(json.decode(response.body));
  _authToken = token.token;
  return token.token;
}
throw Exception(
    "Login failed: ${response.statusCode} body: ${response.body}");

}

发生的异常:

HandshakeException (HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: cannot get local issuer certificate(handshake.cc:354)))

请注意354数字与我之前在其他地方看到的错误不同。 我真的找不到这些异常的具体错误编号。

flutter doctor似乎运行良好,不得不采取额外的步骤来解决许可证问题:

C:\>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.657], locale nl-NL)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code, 64-bit edition (version 1.42.1)
[√] Connected device (1 available)

• No issues found!

已经发现相关问题:

  • https://stackoverflow.com/a/54359013/2901207这不仅为简单的发布请求添加了更多代码,我无法接受。 我想坚持使用http.post()并避免任何代码解决方法。 我不认为这是一个“解决方案”。
  • 我已经查看了所有相关的 github 问题,似乎没有一个很好的解决方案。 大多数问题都在深入研究自签名证书,这些证书似乎与已经托管的服务器而不是本地主机更相关。 我相信 Conveyor 应该已经解决了证书问题,但对于颤振似乎不正确。 看到的问题: #50699#47262#37655#23045

最后一个包括使用IOClient的类似解决方案。 同样在这里,我不认为这是解决方案。 我宁愿找到一个完全避免任何代码调整的解决方案。 所以我想重点是 Conveyor 正确调整它或正确运行 flutter 以接受来自 convoyer 的证书。

可以在flutter run --verbose的整个日志下方找到。 我看到 flutter 团队在每个 github 问题上都要求这样做,所以也许它可以解决任何问题。

[  +27 ms] executing: [C:\flutter\] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +70 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 0b8abb4724aa590dd0f429683339b1e045a1594d
[        ] executing: [C:\flutter\] git describe --match v*.*.* --first-parent --long --tags
[  +43 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.12.13+hotfix.8-0-g0b8abb472
[   +8 ms] executing: [C:\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[  +45 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [C:\flutter\] git ls-remote --get-url origin
[  +40 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +78 ms] executing: [C:\flutter\] git rev-parse --abbrev-ref HEAD
[  +43 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[ +100 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[  +25 ms] Exit code 0 from: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[        ] List of devices attached
           emulator-5554          device product:sdk_gphone_x86 model:Android_SDK_built_for_x86 device:generic_x86
           transport_id:1
[  +17 ms] C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell getprop
[  +54 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[   +6 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +109 ms] Found plugin url_launcher at C:\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-4.2.0+3\
[  +82 ms] Found plugin url_launcher at C:\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-4.2.0+3\
[  +40 ms] Generating
C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\android\app\src\main\java\io\flutter\plugins\GeneratedPluginReg
istrant.java
[  +46 ms] ro.hardware = ranchu
[  +32 ms] Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider
enabling
           software rendering with "--enable-software-rendering".
[  +17 ms] Launching lib\main.dart on Android SDK built for x86 in debug mode...
[   +7 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\build-tools\29.0.3\aapt dump xmltree
C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\build\app\outputs\apk\app.apk AndroidManifest.xml
[  +17 ms] Exit code 0 from: C:\Users\USER\AppData\Local\Android\sdk\build-tools\29.0.3\aapt dump xmltree
C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\build\app\outputs\apk\app.apk AndroidManifest.xml
[   +2 ms] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1c
               A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9")
               A: package="com.example.p2portfolio" (Raw: "com.example.p2portfolio")
               A: platformBuildVersionCode=(type 0x10)0x1c
               A: platformBuildVersionName=(type 0x10)0x9
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=22)
                 A: android:label(0x01010001)="p2portfolio" (Raw: "p2portfolio")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw:
                 "io.flutter.app.FlutterApplication")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw:
                 "androidx.core.app.CoreComponentFactory")
                 E: activity (line=28)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.p2portfolio.MainActivity" (Raw:
                   "com.example.p2portfolio.MainActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: intent-filter (line=35)
                     E: action (line=36)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=38)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw:
                       "android.intent.category.LAUNCHER")
                 E: meta-data (line=45)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
                 E: activity (line=49)
                   A: android:theme(0x01010000)=@0x01030007
                   A: android:name(0x01010003)="io.flutter.plugins.urllauncher.UrlLauncherPlugin$WebViewActivity" (Raw:
                   "io.flutter.plugins.urllauncher.UrlLauncherPlugin$WebViewActivity")
                   A: android:exported(0x01010010)=(type 0x12)0x0
[   +8 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x logcat -v
time -t 1
[  +48 ms] Exit code 0 from: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x
logcat -v time -t 1
[   +2 ms] --------- beginning of main
           03-08 12:13:03.586 E/GnssHAL_GnssInterface( 1764): gnssSvStatusCb: b: input svInfo.flags is 8
[   +8 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe version
[   +1 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 logcat -v time -T
03-08 12:13:03.586
[  +44 ms] Android Debug Bridge version 1.0.41
           Version 29.0.6-6198805
           Installed as C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe
[   +4 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe start-server
[  +63 ms] Building APK
[  +20 ms] Running Gradle task 'assembleDebug'...
[   +3 ms] gradle.properties already sets `android.enableR8`
[   +5 ms] Using gradle from C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\android\gradlew.bat.
[   +7 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +101 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[   +4 ms] openjdk version "1.8.0_212-release"
           OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
           OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
[   +4 ms] executing: [C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\android\]
C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\android\gradlew.bat -Pverbose=true
-Ptarget=C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\lib\main.dart -Ptrack-widget-creation=true
-Pfilesystem-scheme=org-dartlang-root -Ptarget-platform=android-x86 assembleDebug
[ +592 ms] Welcome to Gradle 5.6.2!
[   +2 ms] Here are the highlights of this release:
[   +1 ms]  - Incremental Groovy compilation
[   +3 ms]  - Groovy compile avoidance
[   +1 ms]  - Test fixtures for Java projects
[        ]  - Manage plugin versions via settings script
[   +1 ms] For more details see https://docs.gradle.org/5.6.2/release-notes.html
[+1184 ms] > Task :app:compileFlutterBuildDebug UP-TO-DATE
[   +3 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[   +1 ms] > Task :app:preBuild UP-TO-DATE
[   +3 ms] > Task :app:preDebugBuild UP-TO-DATE
[   +1 ms] > Task :url_launcher:preBuild UP-TO-DATE
[   +3 ms] > Task :url_launcher:preDebugBuild UP-TO-DATE
[   +1 ms] > Task :url_launcher:compileDebugAidl NO-SOURCE
[   +3 ms] > Task :app:compileDebugAidl NO-SOURCE
[   +1 ms] > Task :url_launcher:packageDebugRenderscript NO-SOURCE
[   +4 ms] > Task :app:compileDebugRenderscript NO-SOURCE
[   +1 ms] > Task :app:checkDebugManifest UP-TO-DATE
[   +2 ms] > Task :app:generateDebugBuildConfig UP-TO-DATE
[   +1 ms] > Task :app:cleanMergeDebugAssets
[   +1 ms] > Task :app:mergeDebugShaders UP-TO-DATE
[   +2 ms] > Task :app:compileDebugShaders UP-TO-DATE
[   +1 ms] > Task :app:generateDebugAssets UP-TO-DATE
[   +3 ms] > Task :url_launcher:mergeDebugShaders UP-TO-DATE
[  +56 ms] > Task :url_launcher:compileDebugShaders UP-TO-DATE
[   +2 ms] > Task :url_launcher:generateDebugAssets UP-TO-DATE
[   +3 ms] > Task :url_launcher:packageDebugAssets UP-TO-DATE
[   +1 ms] > Task :app:mergeDebugAssets
[ +292 ms] > Task :app:copyFlutterAssetsDebug
[   +2 ms] > Task :app:mainApkListPersistenceDebug UP-TO-DATE
[   +3 ms] > Task :app:generateDebugResValues UP-TO-DATE
[   +1 ms] > Task :app:generateDebugResources UP-TO-DATE
[   +1 ms] > Task :url_launcher:generateDebugResValues UP-TO-DATE
[   +2 ms] > Task :url_launcher:compileDebugRenderscript NO-SOURCE
[   +1 ms] > Task :url_launcher:generateDebugResources UP-TO-DATE
[   +2 ms] > Task :url_launcher:packageDebugResources UP-TO-DATE
[        ] > Task :app:mergeDebugResources UP-TO-DATE
[   +1 ms] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[        ] > Task :url_launcher:checkDebugManifest UP-TO-DATE
[  +81 ms] > Task :url_launcher:processDebugManifest UP-TO-DATE
[   +3 ms] > Task :app:processDebugManifest UP-TO-DATE
[   +3 ms] > Task :url_launcher:parseDebugLibraryResources UP-TO-DATE
[   +1 ms] > Task :url_launcher:generateDebugRFile UP-TO-DATE
[   +2 ms] > Task :app:processDebugResources UP-TO-DATE
[   +3 ms] > Task :url_launcher:generateDebugBuildConfig UP-TO-DATE
[   +2 ms] > Task :url_launcher:javaPreCompileDebug UP-TO-DATE
[   +1 ms] > Task :url_launcher:compileDebugJavaWithJavac UP-TO-DATE
[   +1 ms] > Task :url_launcher:bundleLibCompileDebug UP-TO-DATE
[  +86 ms] > Task :app:compileDebugKotlin UP-TO-DATE
[   +2 ms] > Task :app:javaPreCompileDebug UP-TO-DATE
[   +3 ms] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[   +1 ms] > Task :app:compileDebugSources UP-TO-DATE
[   +1 ms] > Task :app:processDebugJavaRes NO-SOURCE
[   +3 ms] > Task :url_launcher:processDebugJavaRes NO-SOURCE
[   +1 ms] > Task :url_launcher:bundleLibResDebug UP-TO-DATE
[   +3 ms] > Task :app:mergeDebugJavaResource UP-TO-DATE
[   +6 ms] > Task :url_launcher:bundleLibRuntimeDebug UP-TO-DATE
[   +4 ms] > Task :url_launcher:createFullJarDebug UP-TO-DATE
[   +1 ms] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[  +64 ms] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[   +2 ms] > Task :app:mergeExtDexDebug UP-TO-DATE
[   +3 ms] > Task :app:transformClassesWithDexBuilderForDebug UP-TO-DATE
[   +1 ms] > Task :app:mergeDexDebug UP-TO-DATE
[   +1 ms] > Task :app:validateSigningDebug UP-TO-DATE
[   +1 ms] > Task :app:signingConfigWriterDebug UP-TO-DATE
[   +3 ms] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[   +1 ms] > Task :url_launcher:mergeDebugJniLibFolders UP-TO-DATE
[   +5 ms] > Task :url_launcher:mergeDebugNativeLibs UP-TO-DATE
[   +5 ms] > Task :url_launcher:stripDebugDebugSymbols UP-TO-DATE
[   +4 ms] > Task :url_launcher:transformNativeLibsWithIntermediateJniLibsForDebug UP-TO-DATE
[  +63 ms] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[   +2 ms] > Task :app:stripDebugDebugSymbols UP-TO-DATE
[   +2 ms] Compatible side by side NDK version was not found.
[   +1 ms] > Task :app:packageDebug UP-TO-DATE
[        ] > Task :app:assembleDebug UP-TO-DATE
[        ] > Task :url_launcher:extractDebugAnnotations UP-TO-DATE
[        ] > Task :url_launcher:mergeDebugGeneratedProguardFiles UP-TO-DATE
[   +2 ms] > Task :url_launcher:mergeDebugConsumerProguardFiles UP-TO-DATE
[        ] > Task :url_launcher:prepareLintJarForPublish UP-TO-DATE
[   +2 ms] > Task :url_launcher:mergeDebugJavaResource UP-TO-DATE
[   +1 ms] > Task :url_launcher:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
[        ] > Task :url_launcher:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
[        ] > Task :url_launcher:bundleDebugAar UP-TO-DATE
[        ] > Task :url_launcher:compileDebugSources UP-TO-DATE
[   +2 ms] > Task :url_launcher:assembleDebug UP-TO-DATE
[        ] BUILD SUCCESSFUL in 2s
[   +2 ms] 58 actionable tasks: 3 executed, 55 up-to-date
[ +350 ms] Running Gradle task 'assembleDebug'... (completed in 3,1s)
[  +30 ms] calculateSha: LocalDirectory:
'C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\build\app\outputs\apk'/app.apk
[  +41 ms] calculateSha: reading file took 38us
[ +445 ms] calculateSha: computing sha took 443us
[   +7 ms] √ Built build\app\outputs\apk\debug\app-debug.apk.
[   +7 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\build-tools\29.0.3\aapt dump xmltree
C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\build\app\outputs\apk\app.apk AndroidManifest.xml
[  +21 ms] Exit code 0 from: C:\Users\USER\AppData\Local\Android\sdk\build-tools\29.0.3\aapt dump xmltree
C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\build\app\outputs\apk\app.apk AndroidManifest.xml
[   +2 ms] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1c
               A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9")
               A: package="com.example.p2portfolio" (Raw: "com.example.p2portfolio")
               A: platformBuildVersionCode=(type 0x10)0x1c
               A: platformBuildVersionName=(type 0x10)0x9
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=22)
                 A: android:label(0x01010001)="p2portfolio" (Raw: "p2portfolio")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw:
                 "io.flutter.app.FlutterApplication")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw:
                 "androidx.core.app.CoreComponentFactory")
                 E: activity (line=28)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.p2portfolio.MainActivity" (Raw:
                   "com.example.p2portfolio.MainActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: intent-filter (line=35)
                     E: action (line=36)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=38)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw:
                       "android.intent.category.LAUNCHER")
                 E: meta-data (line=45)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
                 E: activity (line=49)
                   A: android:theme(0x01010000)=@0x01030007
                   A: android:name(0x01010003)="io.flutter.plugins.urllauncher.UrlLauncherPlugin$WebViewActivity" (Raw:
                   "io.flutter.plugins.urllauncher.UrlLauncherPlugin$WebViewActivity")
                   A: android:exported(0x01010010)=(type 0x12)0x0
[   +4 ms] Stopping app 'app.apk' on Android SDK built for x86.
[   +1 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell am
force-stop com.example.p2portfolio
[  +54 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell pm list
packages com.example.p2portfolio
[  +52 ms] package:com.example.p2portfolio
[   +4 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell cat
/data/local/tmp/sky.com.example.p2portfolio.sha1
[  +36 ms] 768e24b43bd762cc7b46297693baa55fc0695949
[   +2 ms] Latest build already installed.
[   +2 ms] Android SDK built for x86 startApp
[   +2 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell am start -a
android.intent.action.RUN -f 0x20000000 --ez enable-background-compilation true --ez enable-dart-profiling true --ez
enable-checked-mode true --ez verify-entry-points true com.example.p2portfolio/com.example.p2portfolio.MainActivity
[ +100 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.example.p2portfolio/.MainActivity
(has extras) }
[   +3 ms] Waiting for observatory port to be available...
[ +500 ms] D/FlutterActivity( 8233): Using the launch theme as normal theme.
[   +7 ms] D/FlutterActivityAndFragmentDelegate( 8233): Setting up FlutterEngine.
[   +1 ms] D/FlutterActivityAndFragmentDelegate( 8233): No preferred FlutterEngine was provided. Creating a new
FlutterEngine for this FlutterFragment.
[ +359 ms] D/FlutterActivityAndFragmentDelegate( 8233): Attaching FlutterEngine to the Activity that owns this Fragment.
[  +57 ms] D/FlutterView( 8233): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@23f561f
[  +27 ms] D/FlutterActivityAndFragmentDelegate( 8233): Executing Dart entrypoint: main, and sending initial route: /
[ +196 ms] Observatory URL on device: http://127.0.0.1:36511/H9d_JaoyPI4=/
[  +18 ms] executing: C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:0
tcp:36511
[ +128 ms] 9700
[  +15 ms] Forwarded host port 9700 to device port 36511 for Observatory
[  +78 ms] Connecting to service protocol: http://127.0.0.1:9700/H9d_JaoyPI4=/
[+1320 ms] Successfully connected to service protocol: http://127.0.0.1:9700/H9d_JaoyPI4=/
[   +4 ms] Sending to VM service: getVM({})
[   +6 ms] Result: {type: VM, name: vm, architectureBits: 32, hostCPU: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz,
operatingSystem: android, targetCPU: ia32, version: 2.7.0 (Fri Dec 6 16:26:51 2019 +0100) on "android_ia32",
_profilerMode: VM, _nativeZoneMemoryUsage: ...
[   +6 ms] Sending to VM service: getIsolate({isolateId: isolates/4001318716464607})
[   +4 ms] Sending to VM service: _flutter.listViews({})
[   +7 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0xf3332210, isolate: {type:
@Isolate, fixedId: true, id: isolates/4001318716464607, name: main.dart$main-4001318716464607, number:
4001318716464607}}]}
[   +6 ms] DevFS: Creating new filesystem on the device (null)
[   +2 ms] Sending to VM service: _createDevFS({fsName: P2PortfolioApp})
[  +40 ms] Result: {type: FileSystem, name: P2PortfolioApp, uri:
file:///data/user/0/com.example.p2portfolio/code_cache/P2PortfolioAppQQIXEI/P2PortfolioApp/}
[   +2 ms] DevFS: Created new filesystem on the device
(file:///data/user/0/com.example.p2portfolio/code_cache/P2PortfolioAppQQIXEI/P2PortfolioApp/)
[   +4 ms] Updating assets
[ +160 ms] Syncing files to device Android SDK built for x86...
[   +4 ms] Scanning asset files
[   +4 ms] <- reset
[   +4 ms] Compiling dart to kernel with 0 updated files
[   +9 ms] C:\flutter\bin\cache\dart-sdk\bin\dart.exe
C:\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
C:\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter
-Ddart.developer.causal_async_stacks=true --output-dill
C:\Users\USER\AppData\Local\Temp\flutter_tool.c68a6d6d-612d-11ea-ae76-d07e35d5bcd0\app.dill --packages
C:\Users\USER\source\repos\P2PortfolioApp\P2PortfolioApp\.packages -Ddart.vm.profile=false -Ddart.vm.product=false
--bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,avoi
d-closure-call-instructions --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root
[   +5 ms] D/EGL_emulation( 8233): eglMakeCurrent: 0xe7fb3240: ver 2 0 (tinfo 0xc8c55440)
[   +7 ms] <- compile package:p2portfolio/main.dart
[  +21 ms] Result: {type: Isolate, id: isolates/4001318716464607, name: main, number: 4001318716464607, _originNumber:
4001318716464607, startTime: 1583665988595, _heaps: {new: {type: HeapSpace, name: new, vmName: Scavenger, collections:
2, avgCollectionPeriodMillis...
[  +24 ms] I/Choreographer( 8233): Skipped 117 frames!  The application may be doing too much work on its main thread.
[ +224 ms] D/EGL_emulation( 8233): eglMakeCurrent: 0xdff1a240: ver 2 0 (tinfo 0xdff0f740)
[+1077 ms] W/IInputConnectionWrapper( 8233): getTextBeforeCursor on inactive InputConnection
[   +2 ms] W/IInputConnectionWrapper( 8233): getSelectedText on inactive InputConnection
[   +1 ms] W/IInputConnectionWrapper( 8233): getTextAfterCursor on inactive InputConnection
[  +19 ms] W/IInputConnectionWrapper( 8233): beginBatchEdit on inactive InputConnection
[   +2 ms] W/IInputConnectionWrapper( 8233): endBatchEdit on inactive InputConnection
[+4401 ms] Updating files
[ +148 ms] DevFS: Sync finished
[   +4 ms] Syncing files to device Android SDK built for x86... (completed in 5.961ms, longer than expected)
[   +2 ms] Synced 0.9MB.
[   +3 ms] Sending to VM service: _flutter.listViews({})
[   +4 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0xf3332210, isolate: {type:
@Isolate, fixedId: true, id: isolates/4001318716464607, name: main.dart$main-4001318716464607, number:
4001318716464607}}]}
[   +2 ms] <- accept
[   +1 ms] Connected to _flutterView/0xf3332210.
[   +3 ms] 🔥  To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".
[   +3 ms] An Observatory debugger and profiler on Android SDK built for x86 is available at:
http://127.0.0.1:9700/H9d_JaoyPI4=/
[   +4 ms] For a more detailed help message, press "h". To detach, press "d"; to quit, press "q".

跳过ssl认证问题的最佳方法。

class MyHttpOverrides extends HttpOverrides{
  @override
  HttpClient createHttpClient(SecurityContext context){
    return super.createHttpClient(context)
      ..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
    }
  }

void main(){
    HttpOverrides.global = new MyHttpOverrides();
    runApp(new MyApp());
}

你用过请求包吗?

https://pub.dev/packages/requests

这里的例子:

var r = await Requests.get('https://expired.badssl.com/', **verify: false**);
r.raiseForStatus();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM