You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I create a native module in Android, throwing an exception , it is Method threw 'com.facebook.react.bridge.ObjectAlreadyConsumedException' exception. Cannot evaluate com.facebook.react.bridge.WritableNativeMap.toString()
my code is:
array=new WritableNativeArray();
for(int i=0;i<fileList.size();i++){
WritableMap map=new WritableNativeMap();
map.putString("uri","file://"+fileList.get(i).getAbsolutePath());
map.putString("fileName",fileList.get(i).getName());
map.putInt("size", (int) fileList.get(i).length());
array.pushMap(map);
}
callback.invoke(array);
React Native version: 0.39.0
Platform: Android
Development Operating System: Windows
Dev tools: Android Studio version 2.1.2,com.android.tools.build:gradle:2.2.3, buildToolsVersion "24.0.2"
Although the error is appeared, but it is not crash, I want to be given a solution ,thanks
The text was updated successfully, but these errors were encountered:
It looks like your description is missing some necessary information. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.
I am going to close this, but feel free to open a new issue with the additional information provided. Thanks!
@hramos
this code is
for(int i=0;i<fileList.size();i++){
WritableMap map=new WritableNativeMap();
map.putString("uri","file://"+fileList.get(i).getAbsolutePath());
map.putString("fileName",fileList.get(i).getName());
map.putInt("size", (int) fileList.get(i).length());
array.pushMap(map);
}
when i >0; the exception is thrown, I guess it is to be caused by the code(WritableMap map=new WritableNativeMap() ), Thanks!
facebook
locked as resolved and limited conversation to collaborators
May 29, 2018
when I create a native module in Android, throwing an exception , it is Method threw 'com.facebook.react.bridge.ObjectAlreadyConsumedException' exception. Cannot evaluate com.facebook.react.bridge.WritableNativeMap.toString()
my code is:
array=new WritableNativeArray();
for(int i=0;i<fileList.size();i++){
WritableMap map=new WritableNativeMap();
map.putString("uri","file://"+fileList.get(i).getAbsolutePath());
map.putString("fileName",fileList.get(i).getName());
map.putInt("size", (int) fileList.get(i).length());
array.pushMap(map);
}
callback.invoke(array);
Although the error is appeared, but it is not crash, I want to be given a solution ,thanks
The text was updated successfully, but these errors were encountered: