nativescript-imagecropper
nativescript-imagecropper copied to clipboard
error: attribute android:requestLegacyExternalStorage not found.
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?
- Android
- during build
Please, provide the following version numbers that your issue occurs with:
- CLI: 6.1.2
- Runtime: "6.1.2"(Android)
- Plugin(s): "dependencies": { "@angular/animations": "^8.2.12", "@angular/common": "^8.2.12", "@angular/compiler": "^8.2.12", "@angular/core": "^8.2.12", "@angular/forms": "^8.2.12", "@angular/http": "^7.2.15", "@angular/platform-browser": "^8.2.12", "@angular/platform-browser-dynamic": "^8.2.12", "@angular/router": "^8.2.12", "@ngx-translate/core": "^11.0.1", "@ngx-translate/http-loader": "^4.0.0", "@nstudio/nativescript-loading-indicator": "^1.0.0", "google-polyline": "^1.0.3", "nativescript-accordion": "^6.0.0-beta.2", "nativescript-angular": "^8.2.2", "nativescript-camera": "^4.5.0", "nativescript-directions": "^1.3.1", "nativescript-drawingpad": "^3.1.0", "nativescript-feedback": "^1.3.12", "nativescript-geolocation": "^5.1.0", "nativescript-google-maps-sdk": "^2.8.1", "nativescript-imagecropper": "^2.0.0", "nativescript-imagepicker": "^7.1.0", "nativescript-modal-datetimepicker": "^1.2.1", "nativescript-ngx-fonticon": "^5.0.0", "nativescript-phone": "^1.4.1", "nativescript-plugin-firebase": "^10.1.0", "nativescript-social-share": "^1.5.2", "nativescript-sound": "^1.0.4", "nativescript-star-ratings": "^1.0.0", "nativescript-texttospeech": "^2.0.3", "nativescript-theme-core": "^2.0.24", "nativescript-ui-sidedrawer": "^7.0.4", "nativescript-vibrate": "^2.1.3", "reflect-metadata": "^0.1.13", "rxjs": "^6.5.3", "tns-core-modules": "^6.1.2", "zone.js": "^0.10.2" }, "devDependencies": { "@angular/cli": "^8.3.14", "@angular/compiler-cli": "^8.2.12", "@nativescript/schematics": "^0.7.2", "@ngtools/webpack": "^8.3.14", "@types/es6-promise": "^3.3.0", "codelyzer": "^5.2.0", "nativescript-dev-webpack": "^1.2.1", "nativescript-iqkeyboardmanager": "^1.5.1", "node-sass": "^4.13.0", "tns-platform-declarations": "^6.1.2", "tslint": "^5.20.0", "typescript": "<3.6.0" },
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.
- What went wrong: Execution failed for task ':verifyReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed /platforms/tempPlugin/nativescript_imagecropper/src/main/AndroidManifest.xml:3:3-5:17: AAPT: error: attribute android:requestLegacyExternalStorage not found.
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
-
Get more help at https://help.gradle.org
Is there any code involved?
- Dont think so. In my understanding, It is during the build of the package.
@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?
@shiv19 Builds fine without android:requestLegacyExternalStorage="true".
However, if I run tns build run android is restores the AndroidManifest.xml.
@CoooWeee I'll pack a plugin without that flag and post it here, you can install that and let me know how it goes.
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
has a patch been release for this bug? I'm still having the same error.
I had this exact problem as well, and your .tgz solves this problem. Please release the patch.
https://github.com/bthurlow/nativescript-imagecropper/issues/49#issuecomment-569754913
https://github.com/bthurlow/nativescript-imagecropper/issues/49#issuecomment-570948851
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.