bthurlow / nativescript-imagecropper

A nativescript image cropping plugin.
Other
49 stars 35 forks source link

error: attribute android:requestLegacyExternalStorage not found. #63

Open CoooWeee opened 5 years ago

CoooWeee commented 5 years ago

Make sure to check the demo app(s) for sample usage

Just add to project (tns plugin add nativescript-imagecropper) and try building. Maybe include it somewhere.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

On a clean build (rm -R hooks platforms node_modules package-lock.json) I get:

FAILURE: Build failed with an exception.

Is there any code involved?

shiv19 commented 5 years ago

@CoooWeee Open node_modules/nativescript-imagecropper/platforms/android/AndroidManifest.xml

<application android:requestLegacyExternalStorage="true">
        <activity android:name="com.yalantis.ucrop.UCropActivity" android:screenOrientation="portrait" android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
    </application>

^ remove the android:requestLegacyExternalStorage="true" part from there. Then run tns platform clean android tns run android

let me know if it works for you.

@jitendraashutec Since you added the android:requestLegacyExternalStorage="true" can you help @CoooWeee or anyone else facing issues with that flag?

was android:requestLegacyExternalStorage only added in API 29?

CoooWeee commented 5 years ago

@shiv19 Builds fine without android:requestLegacyExternalStorage="true". However, if I run tns build run android is restores the AndroidManifest.xml.

shiv19 commented 5 years ago

@CoooWeee I'll pack a plugin without that flag and post it here, you can install that and let me know how it goes.

shiv19 commented 5 years ago

nativescript-imagecropper-2.0.0.tgz.zip

first unzip this file to get nativescript-imagecropper-2.0.0.tgz

place this file in the root of your project and run tns plugin add ./nativescript-imagecropper-2.0.0.tgz

you'll have to keep this file in your project so that other devs can install it from there.

(you could also make a folder called custom_plugins in your project root and keep it in there, then the command would be tns plugin add ./custom_plugins/nativescript-imagecropper-2.0.0.tgz

Let me know if this tgz is working fine for you. If it is, then I'll release a patch

yahyaKacem commented 4 years ago

has a patch been release for this bug? I'm still having the same error.

Noppey commented 4 years ago

I had this exact problem as well, and your .tgz solves this problem. Please release the patch.

shiv19 commented 4 years ago

https://github.com/bthurlow/nativescript-imagecropper/issues/49#issuecomment-569754913

shiv19 commented 4 years ago

https://github.com/bthurlow/nativescript-imagecropper/issues/49#issuecomment-570948851

Gauravkatva commented 3 years ago

Having the same problem, however, if I remove this line android:requestLegacyExternalStorage="true" I am getting another build error. Please let me know how can I solve this error.