Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the loss of R file in Android

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to solve the loss of R file in Android". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to solve the loss of R files in Android.

The R.java file is automatically generated. But sometimes when you write the wrong xml file, R.java will not automatically generate the corresponding value. At this time, we will be very used to clean this project, at this time, we will suddenly find that R.java is gone.

At this time, you must be very angry, you may desperately look for answers online, there will be many answers online to tell you the right-click project-"Android Tools-- > fix project properties". Maybe you can't get R.java out of fix. At this time, you have to consider whether some xml is wrong, something is wrong. As long as there is a problem with the xml file, the system will never automatically generate this R.java file for you, because it has to refer to the data in each of your xml to generate R.java, so it will not be generated naturally.

So when you clear the project, the error changes and becomes an empty package, and the error is also a mistake in the src package. If you encounter such an error and dozens of xml files in the project, it will definitely be depressing or even collapse.

But it doesn't matter. When you clean the project at this time, console will print out an error message:

For example: [2011-08-21 18:14:19-myweibo] F:\ android_workplace\ myweibo\ res\ layout\ home_list.xml:6: error: Error: No resource found that matches the given name (at 'src' with value' @ drawable/usericon').

What is Android? Android is a free and open source operating system based on the Linux kernel, mainly used in mobile devices, such as smartphones and tablets, led and developed by Google and the Open Mobile Alliance.

At this point, I believe you have a deeper understanding of "how to solve the loss of R files in Android". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report