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

Error reading license [Error: ENOENT: no such file or directory] #12

Open
Aleksej3333 opened this issue May 17, 2022 · 3 comments
Open

Comments

@Aleksej3333
Copy link

image

const licPath =
  Platform.OS === 'ios'
    ? RNFS.MainBundlePath + '/regula.license'
    : 'regula.license';
const readFile = Platform.OS === 'ios' ? RNFS.readFile : RNFS.readFileAssets;
const readLicense = async () => {
    try {
      const license = await readFile(licPath);
      console.log('license', license);
    } catch (err) {
      console.log('Error reading license');
    }
  };

[Error: ENOENT: no such file or directory, open '/Users/ag/Library/Developer/CoreSimulator/Devices/51847DA5-88F9-4336-AE1A-16C16499686F/data/Containers/Bundle/Application/3F0BA254-38E9-48B1-834C-DA174431DA57/SimpleFormApplication.app/regula.license']

@Aleksej3333
Copy link
Author

How I can fix it?

@DzmitrySmaliakou
Copy link
Collaborator

DzmitrySmaliakou commented May 19, 2022

Hello, you should add regula.license file to your target in xCode project as it was done in our example

@gamble2020
Copy link

gamble2020 commented Jun 27, 2022

Why don't you guys just provide a base64 string? It would make life so much easier for everyone.

If you have a Mac you can use your terminal like...

base64 regula.license

Copy the string and use as...

    DocumentReader.initializeReader(
      ??Base_64_String??,
      respond => {
        console.log(respond);
        DocumentReader.setConfig(
          {
            processParams: {
              scenario: 'Mrz',
            },
          },
          str => {
            console.log(str);
          },
          error => {
            console.log(error);
          },
        );
      },
      error => console.log(error),
    );

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

No branches or pull requests

3 participants