Java files cannot be automatically generated when aidl is used in Android projects.

Source: Internet
Author: User

Recently, there was a problem that had not been solved for a long time. That is, when aidl is used for inter-process communication, my development environment cannot automatically generate java files under the gen directory.
I use the Ubuntu operating system. The same source can be used in other colleagues' development environments.
Check whether the SDK installation is correct. The aidl compilation tool in the platform-Tools Folder is also quietly there. Why doesn't it work? The salary is too small ??
After Android released the 4.1 Development Kit, we found that both tools and platform-tools have been updated and installed, so we wanted to take this opportunity to see if we could solve the problem.
Install the latest tools and platform-tools. Clean the project and re-build the project. An error is reported, and no error has been reported before.
First, it's done!
Previously, aidl could not generate Java automatically and could be copied from a colleague. The project reports an error. All files under Gen cannot be automatically generated !!!
Do I have to force me to redo the development environment? No way. Fight with him !!! So try a development environment on the Mac machine and install the latest SDK. The same error !!
It seems that the problem is already serious, even if I redo the development environment, it will not solve the problem. He was the only one to solve the problem.
The error is asking me to check the log under his workspace.
Failed to run com. Android. Ide. Eclipse. ADT. Internal. Build. aidlprocessor. Check workspace log for detail.
Open workspace/. Metadata/. Log
! Entry com. Android. Ide. Eclipse. ADT 4 0 11:09:52. 961
! Message failed to run com. Android. Ide. Eclipse. ADT. Internal. Build. aidlprocessor. Check workspace log for detail.
! Stack 0
Java. Lang. nullpointerexception
At com. Android. Ide. Eclipse. ADT. Internal. Build. aidlprocessor. docompilefiles (aidlprocessor. Java: 113)
At com. Android. Ide. Eclipse. ADT. Internal. Build. sourceprocessor. compilefiles (sourceprocessor. Java: 244)
At com. Android. Ide. Eclipse. ADT. Internal. Build. builders. precompilerbuilder. Build (precompilerbuilder. Java: 638)
At org. Eclipse. Core. Internal. Events. buildmanager $ 2.run( buildmanager. Java: 629)
At org. Eclipse. Core. runtime. saferunner. Run (saferunner. Java: 42)
At org. Eclipse. Core. Internal. Events. buildmanager. basicbuild (buildmanager. Java: 172)
At org. Eclipse. Core. Internal. Events. buildmanager. basicbuild (buildmanager. Java: 203)
At org. Eclipse. Core. Internal. Events. buildmanager $ 1.run( buildmanager. Java: 255)
At org. Eclipse. Core. runtime. saferunner. Run (saferunner. Java: 42)
At org. Eclipse. Core. Internal. Events. buildmanager. basicbuild (buildmanager. Java: 258)
At org. Eclipse. Core. Internal. Events. buildmanager. basicbuildloop (buildmanager. Java: 311)
At org. Eclipse. Core. Internal. Events. buildmanager. Build (buildmanager. Java: 343)
At org. Eclipse. Core. Internal. Events. autobuildjob. dobuild (autobuildjob. Java: 144)
At org. Eclipse. Core. Internal. Events. autobuildjob. Run (autobuildjob. Java: 242)
At org.eclipse.core.internal.jobs. Worker. Run (worker. Java: 54)
Search for the reason on Google. Some people have the same question. The answer below includes the following sentence.
I had this exact issue happen to me today. It turns out this happens when there are source folders in your project that do not actually exist.
So verify in your project Java build path that all source folders actually exist. After removing a dead source folder link from there my project once again compiled the aidl.
So I tried to see if there were such folders in my project, and suddenly found a folder with another project name dependent on this project, which is empty.
Due to program debugging, the original project of the original JAR file is introduced, and such a folder is generated without knowing how.
The situation will not be worse than it is now, so no matter whether it is used or not, delete it directly.
An error is returned !!! Files in the gen folder are automatically generated. Solve this problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.