I believe that many beginners will be as often as I on the Internet to find the development of Android source code, but often because the operation is not very annoying! In the sex development site, the collection of app code encountered this difficulty, I believe that the network above the source code most of the above will be manually tested before release, to normal operation will be released, it must be impossible, then how should we solve such a problem? First of all, let's see what the cause of this problem, a source code can not function properly for a number of reasons, such as some projects are time-sensitive, popular is that the project was previously dependent on the service side can be used but now can not use, such as the source of the author of the server closed, Or the software built-in third-party jar is too old to return the data requested by the project, this situation will cause the project to open the run times error, the common phenomenon is to run up after the card in an initial interface is not moving or simply flash back, This situation must be changed or block the need for network detection or service code to solve the problem, the following is the case you downloaded the Android source code imported into eclipse can not run the solution, not the source code to run the wrong solution, then I will teach you one by one troubleshooting
If there is a problem with the downloaded file
The solution is to use the decompression software to open or unzip the process of whether there are any error prompts, if there is an error prompt to download the file again. Or go to other sites to find the relevant resources to download.
Figure out the IDE version
If you determine the download of the compressed package is not a problem, then see if it is not the same as the compilation tool, love to develop the app source forum testing with Android Developer Tools Build: v22.6.2-1085508 (If you do not know how to see the version of the IDE, please Baidu), theoretically adt22.6 the above version can be normal import of the project site. adt22.6 The following is not guaranteed, but you can import several projects to try to test is not all error, if all the error, it may be an IDE problem. If you use Android Studio or other tools, please fix the file import problem yourself
Check that the project import is correct
The correct project import steps are: Open eclipse--> Click file--Select-->import--> click on Android Existing android...--> Click Browse to find your project-- Finally click "Finish" to finish (emphasize that your project must not be placed in the first Eclipse generated workspace directory, otherwise the import will not succeed ...) If you still do not understand, you can read the text tutorial: here
SDK compiled version
Many friends of ADT is on Google's official website or on the internet to find a casual, Google's official website of ADT only with a latest version of the SDK, the lower version of the SDK also need to be downloaded through ADT's own Android SDK Manager. If you don't know which version of the SDK your ADT includes, you can click on the menu on your ADT: window-preferences-android (Chinese Version: Window-Preferences-android) to see which SDKs are available in your environment, This site used to test the source of the SDK often used version: 2.3.7, 4.2.2, 4.4.2, the old source is mostly used 2.3.7 test, Xinyuan code 4.4.2 mostly. If your SDK does not include 4.4.2 or 4.2.2 can go to this site to find the two versions of the SDK download down, how to use the download down the SDK This site is explained, here do not delve into.
Project Coding Issues
Another problem is to determine whether the project code is correct, if you import the source code on the source name has a red fork, point that with a Red Fork folder icon found a name called Src folder icon also has a red fork, in order to open the folder or file with a red fork, Double-click the wrong Java file, in the Code edit window point to the right of the small red Square can quickly navigate to the wrong line of code, see if this line of code is mixed with garbled, then you in your project name right click on the last menu preferences (Chinese version: Preferences) (or click on the project name and press the shortcut key Alt+enter effect), in the pop-up window nothing dot on the right to find the text file encoding (Chinese version: Text files encoding) This item, tick other (Chinese version: Other), If the GBK is displayed, then replace it with UTF-8 if it is UTF-8, then switch to GBK (most commonly used in mainland China is these two codes), click OK. Items will automatically refresh after a few seconds, see if the Red Fork is not gone, if it exists, then select the project Point menu inside the Project->clean...->clean projects selected below (Chinese version: Project--Clean- > Clean up the items selected below) and then tick the item name to clean up the cache. The project cache is forced to be cleaned.
Is there a lack of dependencies
Some of the larger projects mostly include sub-projects or use of third-party library files, you can right-click on your project name to select the last menu preferences (the Chinese version of the name is preferred) (or click on the project name and press the shortcut key Alt+enter effect), On the left side of the Android menu, there will be two small windows on the right, one for project build Target and one for the library. See if there is a red fork in the library there are words put the mouse on the path above the 2 seconds do not move will show the path full name, roughly remember the name, and then point Add,eclipse will automatically list the library you imported, to see if there is a name similar to the name you just remember the point, Double-click will be added, and then remove the error can be removed, but most of the situation is the dot add out of the popup box nothing, this time you will find a way to rely on the library, http://bbs.aiyingli.com/ Release of the source code if necessary the library will be packaged together. If it is found in other areas of the project source, the library estimate is not good to find.
If the jar package is missing
Many projects use some third-party jar packages, but the author uses the jar package may not be placed under the project directory, resulting in the packaging of the time did not go in, others imported the project will go to the source path to find the jar package, but the importer's computer this path must not have this jar package, You can right click on your project name to choose the last menu preferences (Chinese Version: Preferences) (or click the project name and then press the shortcut key Alt+enter effect), point to the left of the Java Build Path Menu (Chinese version: Java build path) a window with four tabs will appear on the right, point libraries (Chinese version: library) window to see if there is a red fork, Red Fork Point Add jars Point open you are solving the problem of this project, then point Libs directory, See if there is a jar package with the same name, double-click the selection if you have one, and then select the jar bag with the Red fork to remove. If you do not have to find a way to make this jar, my practice is to put the jar name in Baidu inside search, see if you can find the same file name files, and then put in the project's Libs directory and then follow the method quoted above, if you can not find that self-blessing. Click OK. Items will automatically refresh after a few seconds, see if the Red Fork is not gone, if it exists, then select the project Point menu inside the Project->clean...->clean projects selected below (Chinese version: Project--Clean- > Clean the selected items below) and then tick the project name to clean up the cache. The last recommended few very good app source download station: Of course, there are a lot of high-quality code CSDN, in addition we can see the app source Forum, the above code is very comprehensive to the force at the same time can be run.
Dry: Android Source Use experience sharing