react-native-cloud-fs icon indicating copy to clipboard operation
react-native-cloud-fs copied to clipboard

[Android] Duplicate Class Error

Open towhid135 opened this issue 1 year ago • 0 comments

Works fine on IOS but on android it throws a duplicate class error. I have tried on Android studio but it couldn't detect the file from where the error raised.

My React-native environment: "react-native": "^0.70.6" "react-native-cloud-fs":^2.7.0 android gradle plugin version: 7.2.2 Gradle-version- 7.5.1


React Native Code:

const IcloudBackUp = () => { const onPressHandler = async () => { try { // Store it on the FS first const path = ${RNFS.DocumentDirectoryPath}/${filename}; await RNFS.writeFile(path, 'Lorem ipsum dolor sit amet', 'utf8');

  const sourceUri = {path};
  const mimeType = 'text/plain';
  const result = await RNCloudFs.copyToCloud({
    mimeType,
    scope,
    sourcePath: sourceUri,
    targetPath: destinationPath,
  });
  console.log('Result of setting items to iCloud', result);
} catch (error) {
  console.log('Error in setting items to iCloud', error);
}

};


app/build.gradle: //Added this compile ('com.google.android.gms:play-services-drive:10.2.0') { force = true; } //Tried with implementation also compile ('com.google.android.gms:play-services-drive:10.2.0') { force = true; }


IOS setup is same as described in the documentation

towhid135 avatar Jan 08 '23 05:01 towhid135