Problems encountered in running uniapp study notes on a real machine

Problems encountered in real machine operation

Using the uni.choseimage API can only open the photo album but not the camera

Environment: packaged into wgt and imported into Android for embedding.
Specific problem: It is no problem to package and run as an app in the HBuilderX base. You can open the camera or the photo album, but import it into the Android android studio project as a plug-in Finally, I can only open the photo album but not the camera, and the error report is not obvious.
This is the red log displayed when I click to open the camera.
insert image description here
Solution: I searched on the Internet and said that it is a permission problem in the Android project, so set the permission and add it
in the Amainfest.xml file The application tag for camera permissions
insert image description here
and you need to add one more content under the application tag in the same file
insert image description here
. The mosaic part is the package name of your own project. Remember not to type it with confidence. Use the method of . to let the compiler find the corresponding The package name (don’t ask, just miss Orz by hand)
and then run it on the real machine in the android studio project, which perfectly solves the problem

The reason for the problem seems to be that Android versions are different, and uniapp has different compatibility methods for different versions. It seems that Android X and above must add the content of the provider tag. This uniapp official website has ~ as shown below

https://nativesupport.dcloud.net.cn/UniMPDocs/FAQ/android

insert image description here

This post is used to put some collections of problems encountered in the use of uniapp...

Guess you like

Origin blog.csdn.net/pure81/article/details/127636285