Eclipse correctly imports third-party projects

Source: Internet
Author: User
Tags git clone

Objective

Last night on a different Android to do the final online test, suddenly a normal upgrade on other platforms features reported "Java.lang.NoClassDefFoundError" error. Hurry adb logcat *:w view the error log and discover that the referenced third-party project class does not exist. Fortunately Ali side Daniel More, and ordinary walk relatively late, a little explanation of my use of the situation, I pointed out the third party project introduced the wrong way, here to record.


The introduction of the engineering step is an example of how to add "Android-pulltorefresh" to my test project in the "Android-pulltorefresh", an open source project that is currently very well known.
Create a test project, import a Pulltorefresh project create a test project there's nothing to say, it's you new Android project.
The steps to import Pulltorefresh engineering are as follows:
1. Git clone works to a local directory
git clone https://github.com/chrisbanes/Android-PullToRefresh.git

2. To import the project to eclipse, proceed as follows:
File--Import--android--Existing android Code into Workspace

Next, Browser, select the Pulltorefresh Project catalog, finish can (only import library here)

Statically Importing library libraries
1. Select the project that you want to rely on Pulltorefresh right-click Properties

2. Under the Library column, click Add to add the previously Pulltorefresh Library project.

3. Project---clean projects.
To verify that the third-party project is imported correctly, you can view the Project.Properties file for the project itself, as follows:
# This file was automatically generated by Android tools.# does not modify this file--YOUR changes would be erased!## this F Ile must is checked in Version Control systems.## to customize properties used by the Ant build system edit# "Ant.properti  Es ", and override values to adapt the script to your# project structure.## to enable Proguard to shrink and obfuscate your Code, uncomment this (available Properties:sdk.dir, user.home): #proguard. config=${sdk.dir}/tools/proguard/ proguard-android.txt:proguard-project.txt# Project target.target=android-19android.library.reference.1=. /.. /.. /.. /tmp/android-pulltorefresh/library
The presence of android.library.refreence.* means that you have correctly imported a third-party project, enjoy!




Related Article

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.