Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dio unknown error in release mode #1872

Closed
HamedDN opened this issue Jun 16, 2023 · 7 comments
Closed

Dio unknown error in release mode #1872

HamedDN opened this issue Jun 16, 2023 · 7 comments

Comments

@HamedDN
Copy link

HamedDN commented Jun 16, 2023

Package

Dio

Version

all

Output of flutter doctor -v

[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.19045.3086], locale en-US)
    • Flutter version 3.10.5 on channel stable at C:\Users\DELL\Documents\Dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (3 days ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\DELL\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.3.32929.385
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] VS Code (version 1.79.2)
    • VS Code at C:\Users\DELL\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.66.0

[√] Connected device (4 available)
    • 22101320G (mobile) • 48da4c08 • android-arm64  • Android 13 (API 33)
    • Windows (desktop)  • windows  • windows-x64    • Microsoft Windows [Version 10.0.19045.3086]
    • Chrome (web)       • chrome   • web-javascript • Google Chrome 114.0.5735.134
    • Edge (web)         • edge     • web-javascript • Microsoft Edge 114.0.1823.43

[√] Network resources
    • All expected network resources are available.

Dart Version

3.0.5

Code

try
{
Dio dio = Dio();
Response e = await dio.get(serverPath);
Fluttertoast.showToast(
msg: e.toString(),
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0
);
}
catch (e)
{
Fluttertoast.showToast(
msg: e.toString(),
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0
);
}

Expected Result

response of path

Actual Result

fail to lookup (serverpath) // in Release Mode
succsess // in debug mode

@HamedDN HamedDN added h: need triage This issue needs to be categorized s: bug Something isn't working labels Jun 16, 2023
@kuhnroyal
Copy link
Member

Well, what is your serverPath in release/debug mode?

@kuhnroyal
Copy link
Member

If this is some Android app, maybe you are missing the internet permission?

@HamedDN
Copy link
Author

HamedDN commented Jun 17, 2023

the permission is granted, it works in debug mode.

@AlexV525
Copy link
Member

Can you check your AndroidManifest.xml under app/src/main? DEBUG by default has this permission declared but PROFILE and RELEASE does not.

@AlexV525
Copy link
Member

Also, try to reproduce this with a minimal example or a new project to indicate whether it's a project-specific issue.

@HamedDN
Copy link
Author

HamedDN commented Jun 17, 2023

Can you check your AndroidManifest.xml under app/src/main? DEBUG by default has this permission declared but PROFILE and RELEASE does not.

thanks man, it works :)

@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
@AlexV525 AlexV525 added i: out of support and removed h: need triage This issue needs to be categorized s: bug Something isn't working labels Jun 17, 2023
@yangdehui
Copy link

I got the same error on the Windows side, unknown error, response body is null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants