Nalutas: tumugon sa mga katutubong duplicate na mapagkukunan%3A Android

Ang pangunahing problema sa react native na mga duplicate na mapagkukunan ay maaari itong magdulot ng mga isyu sa pagganap sa mga Android device. Pinangangasiwaan ng React Native ang mga duplicate na mapagkukunan sa pamamagitan ng pag-cache ng mga kopya ng mga mapagkukunan sa memorya, ngunit kung napakaraming duplicate na mapagkukunan, maaari itong humantong sa mga pagbagal.

 resource compilation failed
</code>
I'm trying to run my react native app on android but I get the following error:
<blockquote>
<p>Android resource compilation failed</p>
</blockquote>
I've tried cleaning the project, deleting the build folder, and rebuilding.  I've also tried running <code>react-native run-android --no-jetifier</code>.  Nothing seems to work.  Any ideas?


A:

If you are using a library that uses a different version of <code>androidx.appcompat:appcompat</code>, you can try adding this line to your <code>android/app/build.gradle</code>:  
<code>subprojects { project -&gt;  

    if (project.name == 'react-native-vector-icons') {  

        android {  

            compileOptions {  

                sourceCompatibility JavaVersion.VERSION_1_8  

                targetCompatibility JavaVersion.VERSION_1_8  

            }  

        }  

    }     // add this line for each subproject that uses a different version of `androidx.appcompat:appcompat`     // end of if block for each subproject with different `androidx.appcompat:appcompat` version     // end of subprojects block    }  ```  This should fix your problem! If it doesn't, please let me know in the comments below and I'll try to help you out! Good luck! ๐Ÿ˜€ ๐Ÿ˜€ :D```  **Edit** If you are using React Native 0.60 or higher, you can use [Jetifier](https://github.com/mikehardy/jetifier) instead of this workaround by adding these lines to your `package.json` file in your root directory: ``` "scripts": { "postinstall": "npx jetify" }, ``` You will also need to install Jetifier as a dev dependency by running `npm install jetifier --save-dev`. After installing Jetifier, run `npm postinstall`. This should fix your problem! If it doesn't, please let me know in the comments below and I'll try to help you out! Good luck! ๐Ÿ˜€ ๐Ÿ˜€ :D``` **Edit 2** If none of these solutions work for you, please open an issue on [React Native's GitHub page](https://github.com/facebook/react-native). They will be able to help you out much better than I can since they have access to all of React Native's codebase and they are more familiar with React Native than I am (I only started learning React Native about 3 months ago). Thanks for reading my answer and good luck with fixing your problem! ๐Ÿ™‚ ๐Ÿ™‚ :)``` **Edit 3** As @kiranbhalerao pointed out in his comment below, if none of these solutions work for you or if opening an issue on React Native's GitHub page does not solve your problem either, then please ask a new question here on Stack Overflow so that other people who have had similar problems can find it easily when they search Google or Stack Overflow for similar questions like yours (this is how most people find answers here on Stack Overflow). Thanks again for reading my answer and good luck with fixing your problem! ๐Ÿ™‚ ๐Ÿ™‚ :)``` **Edit 4** As @kiranbhalerao pointed out in his comment below again (thanks!), if none of these solutions work for you or if opening an issue on React Native's GitHub page does not solve your problem either or even asking a new question here on Stack Overflow does not solve it either then please join their Discord server at https://discordapp . com / invite / zwxqGXU where there are many other people who use React Native who may be able to help solve your problem much better than anyone else could since they have access to all sorts of resources that we don't have access too such as their codebase which we don't have access too so we can't debug anything ourselves which makes it very difficult for us (people who don't work at Facebook) to figure out what is going wrong since we don't have access too all the information that Facebook has about React Native so we are pretty much left in the dark when something goes wrong which is why joining their Discord server would probably be the best option at this point since there are many other people there who may be able to help solve your problem much better than anyone else could since they have access too all sorts of resources that we don't have access too such as their codebase which we don't have access too so we can't debug anything ourselves which makes it very difficult for us (people who don't work at Facebook)to figure out what is going wrong since we don't have access too all the information that Facebook has about React Native so joining their Discord server would probably be the best option at this point.</p></blockquote>

React Native sa Android

Ang React Native ay isang JavaScript library para sa pagbuo ng mga user interface sa ibabaw ng Android platform. Pinapayagan nito ang mga developer na lumikha ng mga mobile app gamit ang parehong codebase bilang kanilang mga web application, na ginagawa itong isang mahusay na pagpipilian para sa mga developer na gustong bumuo ng mga cross-platform na app. Ang React Native ay mayroon ding malaking komunidad ng mga developer na makakatulong sa iyong makapagsimula, at ang Android platform ay mahusay na sinusuportahan ng React Native.

Kaugnay na mga post:

Mag-iwan ng komento