This is the 12th day of my participation in the August Challenge

Problem description

When react-native image-crop-picker v0.35.0 is introduced, the following error occurs: openPicker not defined is reported on the client.

The solution

The Gradle version needs to be upgraded to recognize the new query elements.

buildscript {
  ...
    dependencies {
        classpath("Com. Android. Tools. Build: gradle: 3.5.4." ")// Upgrade to patch version}}Copy the code

The Android Gradle plug-in needs to know about new list elements, especially the list merge process. If the plug-in sees an element in the manifest merge that it does not recognize, it can get confused and throw a build error like the one in the problem.

In this case, Android 11 is introduced as a listing element, which is unknown to older versions of Android Gradle plug-ins.

The fact that this happened because of a manifest merge means that upgrading dependencies only could cause this error. For example, if the latest version you upgraded to, com.awesome: awl-library, contains an element in its manifest, you may crash because of the above error in your build, even if nothing else changes in your code.

Google has released a series of patches for the Android Gradle plugin to address this issue:

  • 3.3.3

  • Rule 3.4.3

  • 3.5.4

  • 3.6.4 radar echoes captured

  • 4.0.1

Personal understanding

RN looks great, but there are a lot of holes in the configuration, and many things don’t fit well or are backward compatible. So there was a lot of searching going on for how to fix the bug. It actually affects the development experience, not as much as Flutter.

The community ecosystem is perfect, the functions you need, the community basically have open source implementation plan, but the bad point is that the quality of the open source code is uneven, the project depends on the third party components are basically their own modification.

To sum up, it is better for big projects to be original at this stage, so RN will just play with pictures. In my opinion