נפתרה: הגיב למשאבים כפולים מקוריים%3A אנדרואיד

הבעיה העיקרית במשאבים כפולים מקוריים של תגובה היא שזה יכול לגרום לבעיות ביצועים במכשירי אנדרואיד. React Native מטפל במשאבים כפולים על ידי שמירה במטמון של העותקים של המשאבים בזיכרון, אך אם יש יותר מדי משאבים כפולים, הדבר עלול להוביל להאטות.

 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 באנדרואיד

React Native היא ספריית JavaScript לבניית ממשקי משתמש על גבי פלטפורמת אנדרואיד. זה מאפשר למפתחים ליצור אפליקציות לנייד באמצעות אותו בסיס קוד כמו יישומי האינטרנט שלהם, מה שהופך אותו לבחירה מצוינת עבור מפתחים שרוצים לבנות אפליקציות חוצות פלטפורמות. ל-React Native יש גם קהילה גדולה של מפתחים שיכולים לעזור לך להתחיל, ופלטפורמת האנדרואיד נתמכת היטב על ידי React Native.

הודעות קשורות:

השאירו תגובה