question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support to targetSdkVersion 30 android 11

See original GitHub issue

I was updating my project to React native 0.64.2 and my sdk is pointing to version 30, in preparation for the request from the playstore for November, but I am having problems with this library with devices with android 11 Error: RNHTMLtoPDF error: Could not create folder structure. is the error that is giving me.

Before to support sdk 29 i used android: requestLegacyExternalStorage = "true" but this will no longer be a solution for android 11, what would be the solution now for android 11 target sdk30?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ozzfelipecommented, Nov 4, 2021

Removing directory parameter works for me. I was using directory as “documents”.

1reaction
SohelKabircommented, Nov 7, 2021

Hey I was facing the same issue in target SDK 30 and gladly found a solution. First look at my code

async function createPDF(params) {
  const html = getHTMLPage(params);
  const options = {
    html,
    fileName: getFileName(params.entryType),
    directory: 'Documents',
    // height: 792,
    // width: 612,
  };
  const file = await RNHTMLtoPDF.convert(options);
  RNFetchBlob.android.actionViewIntent(file.filePath, 'application/pdf');
}

I was saving the file to Documents directory and it was just saving fine (log the file after save) but when i was viewing the file with RNFetchBlob that’s where I was getting the error. So my problem was with viewing the file with RNFetchBlob. If your problem is same try to add these lines in AndroidManifest.xml

    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:mimeType="*/*" />
        </intent>
    </queries>

Hope it solves your problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set up the Android 11 SDK
Click Tools > SDK Manager. · In the SDK Platforms tab, select Android 11. · In the SDK Tools tab, select Android SDK...
Read more >
Meet Google Play's target API level requirement
New apps must target Android 12 (API level 31) or higher; except for Wear OS apps, which must target Android 11 (API level...
Read more >
Behavior changes: Apps targeting Android 11
The following behavior changes apply exclusively to apps that are targeting Android 11 or higher. If your app sets targetSdkVersion to 30 ,...
Read more >
Migrating apps to Android 11
To get started with full Android 11 support, first download the Android 11 SDK (and any other tools needed) into Android Studio. Next...
Read more >
Compatibility framework changes (Android 11)
This page describes each app-impacting behavior change that was added to the compatibility framework in Android 11 (API level 30).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found