Skip to content

Exception is thrown in the code, but it works normally #14183

@iamdurui

Description

@iamdurui

hf omj6 g6rh xz1a7nq6

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions