ivpusic/react-native-image-crop-picker

unexpected element <queries> found in <manifest>

Onibenjo opened this issue ยท 26 comments

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.35.0
  • react-native v0.63.2

Platform

Tell us to which platform this issue is related

  • iOS
  • Android

Expected behaviour

Successful build

Actual behaviour

node_modules\react-native-image-crop-picker\android\build\intermediates\library_manifest\debug\AndroidManifest.xml:10:5-14:15: AAPT: error: unexpected element found in

Steps to reproduce

  1. npm i react-native-image-crop-picker
  2. react-native run-android

Attachments

// stacktrace or any other useful debug info

Love react-native-image-crop-picker? Please consider supporting our collective:
๐Ÿ‘‰ https://opencollective.com/react-native-image-crop-picker/donate

upgrade your gradle version to be able to recognize new queries element. cc https://stackoverflow.com/questions/62969917/how-do-i-fix-unexpected-element-queries-found-in-manifest

thank you, it fixed it.

Even after upgrading gradle to 6.5.1 , I keep getting the same error.
My react-native info:

System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
Memory: 25.10 MB / 4.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.6 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 23.0.3, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.2, 29.0.3
Android NDK: Not Found
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_212 - /usr/bin/javac
Python: 2.7.15 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

You could check this out: https://stackoverflow.com/a/62969918/3501012

After that before new build run:
cd android && ./gradlew clean
cd android && ./gradlew cleanBuildCache

Thank you guys. I already upgraded gradle using:
'brew upgrade gradle'
but get same error. I tried to clean and rebuild but the error remains there.

Solution was to downgrade using:
yarn add react-native-image-crop-picker@^0.33.2

My info:

System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
Memory: 28.05 MB / 4.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.6 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 23.0.3, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.2, 29.0.3
Android NDK: Not Found
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_212 - /usr/bin/javac
Python: 2.7.15 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
react-native-macos: Not Found

Hi @SUMITIOS if we downgrade to 0.33.2, how can we get the fix included in 0.35 which fixes the camera on Android 11.

No need to downgrade to 0.33.
Upgrade your gradle version classpath 'com.android.tools.build:gradle:4.0.1' or classpath('com.android.tools.build:gradle:4.0.1')

Upgrade gradle to 4.0.1 fixed the issue
thanks @Onibenjo

I can confirm, upgrading to 4.0.1 fixed the issue. Thanks guys

No need to downgrade to 0.33.
Upgrade your gradle version classpath 'com.android.tools.build:gradle:4.0.1'

Thanx, this really solved the issue, I was upgrading gradle version on my system instead of the project. Now its fine but I am facing camera permission error. Hope to get rid of that too. Thanx a lot

@zzeerak thank you downgrading works fine.

Thank you guys. I already upgraded gradle using:
'brew upgrade gradle'
but get same error. I tried to clean and rebuild but the error remains there.

Solution was to downgrade using:
yarn add react-native-image-crop-picker@^0.33.2

My info:

System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
Memory: 28.05 MB / 4.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.6 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 23.0.3, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.2, 29.0.3
Android NDK: Not Found
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_212 - /usr/bin/javac
Python: 2.7.15 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
react-native-macos: Not Found

downgrade to this version, solved to me! thanks!

@zzeerak thank you downgrading works fine.

@lfoliveir4 and @kigh143 thank you but plz note that downgrading to 0.33 may cause issue on Android 11 as mentioned by @zzeerak . So kindly check if it works properly on Android 11, otherwise upgrade your project's gradle version by adding classpath('com.android.tools.build:gradle:4.0.1') (inside android/build.gradle dependencies) and use picker version 0.35.0.

yea.... downgrading might work but the best option is to upgrade your gradle in your build.gradle file and not your system gradle version @lfoliveir4

classpath('com.android.tools.build:gradle:4.0.1')

Worked for me!

But I got the following error..

Execution failed for task ':app:stripDebugDebugSymbols'.

No version of NDK matched the requested version 21.0.6113669. Versions available locally: 20.0.5594570, 21.2.6472646

@amitsharma-007
If your local NDK version (ie 21.2.6472646) is greater than the requested version (21.0.6113669) you need to mention it inside your android/app/build.gradle file in android {....} as ndkVersion "21.2.6472646" and you will be good to go.
This issue is not related specifically to image picker for more follow
https://stackoverflow.com/questions/60404457/no-version-of-ndk-matched-the-requested-version

i install this package in my project and i have an error saying
task :app:processdebugresources failed deprecated gradle features were used in this build, making it incompatible with gradle 7.0.

But why the app is crashing when opening camera ?

@iamabdulhaseeb I guess you should open a new issue for that

I also had the same problem.
I fixed it like this.

  1. react-native-image-crop-picker's version downgrade ("react-native-image-crop-picker": "0.36.0" -> "react-native-image-crop-picker": "0.32.2") in "package.json" file

  2. and "node_modules" and "package-lock.json" file deleted.
    : rm -rf node_modules, rm -rf package-lock.json or rm -rf node_modules && package-lock.json

  3. then npm install reinstall node_modules.

  4. then you should check react-native-image-crop-picker's version in package-lock.json and package.json file.
    : if you can checked downgrade version both file โ†“ next step

  5. open the "Android Studio" App and open your project android folder(directory) and run "Gradle Sync" and "Build Clean".

  6. finally your editor command line you write "react-native run-android", then you can watch the success build!

Good luck!

hu-qi commented

upgrade your gradle version to be able to recognize new queries element. cc https://stackoverflow.com/questions/62969917/how-do-i-fix-unexpected-element-queries-found-in-manifest

Thanks! Upgrade gradle to 3.5.4 fixed the issue in my case.

-  classpath("com.android.tools.build:gradle:3.5.3")
+ classpath("com.android.tools.build:gradle:3.5.4")

1st upgrade the Gradle
Inside android>gradle>wrapper>gradle-wrapper.properties
update the distributionUrl to your specific gradle like :
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
then
inside android>build.gradle
classpath('com.android.tools.build:gradle:4.0.1')
in my case it was
classpath('com.android.tools.build:gradle:3.4.2')
then cd android && ./gradlew clean
and you are done

Thank you guys. I already upgraded gradle using:
'brew upgrade gradle'
but get same error. I tried to clean and rebuild but the error remains there.

Solution was to downgrade using:
yarn add react-native-image-crop-picker@^0.33.2

My info:

System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
Memory: 28.05 MB / 4.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.6 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 23.0.3, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.2, 29.0.3
Android NDK: Not Found
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_212 - /usr/bin/javac
Python: 2.7.15 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
react-native-macos: Not Found

The only solution that helped

upgrade your gradle version to be able to recognize new queries element. cc https://stackoverflow.com/questions/62969917/how-do-i-fix-unexpected-element-queries-found-in-manifest

Thanks! Upgrade gradle to 3.5.4 fixed the issue in my case.

-  classpath("com.android.tools.build:gradle:3.5.3")
+ classpath("com.android.tools.build:gradle:3.5.4")

Upgrade gradle from 3.5.3 to 3.5.4 fixed the issue in my case as well.

1st upgrade the Gradle
Inside android>gradle>wrapper>gradle-wrapper.properties
update the distributionUrl to your specific gradle like :
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
then
inside android>build.gradle
classpath('com.android.tools.build:gradle:4.0.1')
in my case it was
classpath('com.android.tools.build:gradle:3.4.2')
then cd android && ./gradlew clean
and you are done

This fixed for me.

I am facing issue in realme phones and some android 11 versinon phone when i am clicking photo so after click i am submit the button for upload so my app is reloading and i am not getting any error and not getting any value on console because app is reloading