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
type '_OneByteString' is not a subtype of type 'Map<String, dynamic>' #883
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions. |
this is still an issue. |
In Release mode, the app is working fine, but after few hours i got this same issue, for me also but if i clear the cache its working perfectly... |
by clearing cache you mean the application cache? |
Yeah @easazade |
i guess it could be a cache problem since whenever i quit app and launch it again. everything works fine. |
Actually, What's the solution for this issue to overcome @easazade |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions. |
this is issue is still, i. meet. |
I have the same problem too and it is in shared preferences when I use this line |
@Maged12 you are passing string value in bool type when a value from your shared preference is null. Should be following..
|
+1 |
+1 |
hey, any solution for that ?? it's still an issue for me |
hey, any solution for that ?? it's still an issue for me |
type '_OneByteString' is not a subtype of type 'int' of 'index' |
I have the same problem. On one device, with released app. |
how can i fix it ? its still appear on my crashlytics |
this is still an issue. @easazade how did you resolve this? |
@Asquare17 I didn't. it just didn't happen for me when i built the app apk. it just happened sometimes when i ran app in release mode directly on device |
We have seen the same issue on Crashlytics console: |
+1, only happens in Release mode |
how to fix it ? its still appear on my crashlytics console |
still appearing on |
It's still appearing in release mode any solution for this ?? |
I am getting the same error when trying to parse a value from api to bool. But I realized that the api I am using is sending boolean in text ( enum CustomBoolean {
TRUE,
FALSE,
NOT_SELECTED;
} If it is your case I've solved this creating a simple parser: static CustomBoolean parse(String source) {
source
..replaceAll(" ", "_")
..toUpperCase()
..trim();
switch (source) {
case "TRUE":
return CustomBoolean.TRUE;
case "FALSE":
return CustomBoolean.FALSE;
default:
return CustomBoolean.NOT_SELECTED;
}
} By doing this we are converting the string from the api to a enum value. To get a bool value you can change the enumeration values on switch statement to booleans has well, in my case I prefered setting values on the enum: enum CustomBoolean {
TRUE(true),
FALSE(false),
NOT_SELECTED(false);
final bool value;
const CustomBoolean(this.value);
static CustomBoolean parse(String source) {
source
..replaceAll(" ", "_")
..toUpperCase()
..trim();
switch (source) {
case "TRUE":
return CustomBoolean.TRUE;
case "FALSE":
return CustomBoolean.FALSE;
default:
return CustomBoolean.NOT_SELECTED;
}
}
}
|
I got similar issue saying final accessToken = authResult['access_token'];
UserCompanion.insert(
id: Value(user.id),
authCode: code,
accessToken: accessToken,
); So the type of the final accessToken = authResult['access_token'] as String;
UserCompanion.insert(
id: Value(user.id),
authCode: code,
accessToken: Value(accessToken),
); |
Check your StackTrace. The first 10 lines will be enough. Cover your |
Which is the solution? I also have this issue: |
Any solution for this? |
This should be fixed already in cce167e. |
Can you paste here the StackTrace and the code where the error occurs? So then we can suggest something. But, just as @WiRight pointed above, most of the time this error occurs when accessing a key that exists in a map but with wrong type than what you expect. In my case, API was returning a string To solve this, i made a simple parser to read the string and pass it to boolean. Details
static bool? tryParseBoolean(String source) {
source
..toUpperCase()
..trim();
switch (source) {
case "TRUE":
return true;
case "FALSE":
return false;
default:
return null;
}
} |
A value of type '_OneByteString' can't be assigned to a variable of type 'String?'. any solution for that? |
This is an error I get only in release mode (weird) when I'm trying to parse response body of a network request i made into a json map. I put down the code and also the error stacktrace below.
the other wierd thing i should mention is that it only happens sometimes. not all the time. but for the apps i have released on the market when i check the crash reports on firebase this error is also reported there. (it does not cause a crash, though)
I found out that it happens sometimes but when it happens it keeps happening when i send the same request or sometimes other request over and over. until i quit the app and run it again.
Error stacktrace :
my code :
additional info :
platform i test on : android
platform version : 8.0
dio version : 3.0.9
report rate : 5 % of the time only in release mode
The text was updated successfully, but these errors were encountered: