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

@nativescript/imagepicker does not show selected image after app is build in release mode #572

Open
leocrawf opened this issue Feb 14, 2024 · 8 comments

Comments

@leocrawf
Copy link

I am having an issue now where @nativescript/imagepicker works perfectly when I do ns run android, wherein I am able to see the images in their respective folders and make a selection and the selected image is shown in my ui as the selected image. However, after I do a ns build releease .... the apk or aab file does not show the selected image. I am able to see the images list in their respective folders, make a selection but then it does not appear in my ui as selected, as If I had selected nothing. My package.json is as shown before:

"dependencies": {
"@nativescript-community/drawingpad": "^4.1.0",
"@nativescript-community/https": "^4.1.8",
"@nativescript-community/perms": "^2.3.0",
"@nativescript/appavailability": "^2.0.0",
"@nativescript/background-http": "^6.0.0",
"@nativescript/core": "~8.6.0",
"@nativescript/directions": "^2.0.2",
"@nativescript/email": "^2.1.0",
"@nativescript/imagepicker": "^3.0.1",
"@nativescript/social-share": "^2.3.0",
"@nativescript/theme": "~3.0.2",
"@nstudio/nativescript-carousel": "^8.0.3",
"@nstudio/nativescript-checkbox": "^2.0.5",
"@nstudio/nativescript-loading-indicator": "^4.3.4",
"@triniwiz/nativescript-image-cache-it": "^7.4.0",
"@triniwiz/nativescript-toasty": "^4.1.3",
"moment": "^2.30.1",
"nativescript-audio": "^6.2.6",
"nativescript-feedback": "^2.0.0",
...
},
"devDependencies": {
"@nativescript/android": "8.6.2",
"@nativescript/webpack": "~5.0.18"
}

and the relevant settings in my AndroidManifest are:

The relevant part of my app.gradle is:
android {
compileSdkVersion 33
buildToolsVersion "33"
defaultConfig {
minSdkVersion 23
targetSdkVersion 33
versionCode 10074
}

I am using open jdk 14.

@hw-barry
Copy link

I got the same problem.Finally, i solved this problem with following way, just downgrade version to v1.0.10, then it work properly.

@IvanTonchev
Copy link

IvanTonchev commented Apr 19, 2024

Downgrading the package did not help as the permissions would no longer work on Android13+.
PS: The problem affects only the recent versions of Android, works on 7 or 10.

@leocrawf
Copy link
Author

to solve the issue i had to get help from the native script discord. i recommend that you join.

@pabloposada09
Copy link

@leocrawf could you share here what was the solution that you got in the discord ?

@insytes
Copy link
Contributor

insytes commented Jun 7, 2024

@leocrawf What was the solution? I am seeing this problem too.

@IvanTonchev
Copy link

Using imagepicker 3.1.1, and following the advice from the discord discussion, i managed to get it working by adding this line to my app.gradle dependencies:

implementation("androidx.documentfile:documentfile:1.0.1")

Like this (some lines omitted for brevity):

android {
dependencies {
constraints {
...
}
implementation("androidx.documentfile:documentfile:1.0.1")
}
...
}

@insytes
Copy link
Contributor

insytes commented Jun 7, 2024

@IvanTonchev brilliant, thanks for your help 👍🏻

@PixsaOJ
Copy link

PixsaOJ commented Sep 4, 2024

#551 related

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

No branches or pull requests

6 participants