2012-07-02 3 views
11

안녕하세요 모든 어떻게 이클립스를 사용하여 안드로이드에서 만든 내 프로젝트의 항아리 파일을 만들 수 있습니다. 나는이 과정을 프로젝트 -> 마우스 오른쪽 버튼으로 클릭 -> 내보내기 -> 빌더 선택 -> antbuilder -> ok이 과정 후 build.xml이 생성됩니다. bulid.xml에서 새 빌더를 작성합니다.이클립스에서 안드로이드 프로젝트 용 항아리 만들기

  • 프로젝트 -> 등록 정보 -> 새로 선택 -> build.xml 및 프로젝트 경로를 마우스 오른쪽 버튼으로 클릭하고 확인을 누르면 새 빌더가 작성됩니다.
  • 이제 프로젝트 속성에서 해당 빌더를 선택하고 확인을 누릅니다.
  • 이제 프로젝트를 빌드하면 bin 폴더에 jar 파일이 만들어집니다.

위의 과정을 수행했지만 내 jar 파일이 bin 폴더에 없습니다. 내 build.xml이 생성되고 모든 프로세스가 원활하게 진행되지만 여전히 jar 파일이 생성되지 않은 것을 볼 수 있습니다. 아무도 내가 어떻게 이럴 수 있니?

내 build.xml 파일 이클립스에서

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<!-- WARNING: Eclipse auto-generated file. 
       Any modifications will be overwritten. 
       To include a user specific buildfile here, simply create one in the same 
       directory with the processing instruction <?eclipse.ant.import?> 
       as the first entry and export the buildfile again. --> 
<project basedir="." default="build" name="testtttttttttt"> 
    <property environment="env"/> 
    <property name="debuglevel" value="source,lines,vars"/> 
    <property name="target" value="1.6"/> 
    <property name="source" value="1.6"/> 
    <path id="Android 2.2.libraryclasspath"> 
     <pathelement location="C:/Program Files (x86)/Android/android-sdk/platforms/android-8/android.jar"/> 
    </path> 
    <path id="com.android.ide.eclipse.adt.LIBRARIES.libraryclasspath"/> 
    <path id="testtttttttttt.classpath"> 
     <pathelement location="bin/classes"/> 
     <path refid="Android 2.2.libraryclasspath"/> 
     <path refid="com.android.ide.eclipse.adt.LIBRARIES.libraryclasspath"/> 
    </path> 
    <target name="init"> 
     <mkdir dir="bin/classes"/> 
     <copy includeemptydirs="false" todir="bin/classes"> 
      <fileset dir="src"> 
       <exclude name="**/*.java"/> 
      </fileset> 
     </copy> 
     <copy includeemptydirs="false" todir="bin/classes"> 
      <fileset dir="gen"> 
       <exclude name="**/*.java"/> 
      </fileset> 
     </copy> 
    </target> 
    <target name="clean"> 
     <delete dir="bin/classes"/> 
    </target> 
    <target depends="clean" name="cleanall"/> 
    <target depends="build-subprojects,build-project" name="build"/> 
    <target name="build-subprojects"/> 
    <target depends="init" name="build-project"> 
     <echo message="${ant.project.name}: ${ant.file}"/> 
     <javac debug="true" debuglevel="${debuglevel}" destdir="bin/classes" source="${source}" target="${target}"> 
      <src path="src"/> 
      <classpath refid="testtttttttttt.classpath"/> 
     </javac> 
     <javac debug="true" debuglevel="${debuglevel}" destdir="bin/classes" source="${source}" target="${target}"> 
      <src path="gen"/> 
      <classpath refid="testtttttttttt.classpath"/> 
     </javac> 
    </target> 
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/> 
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler"> 
     <copy todir="${ant.library.dir}"> 
      <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/> 
     </copy> 
     <unzip dest="${ant.library.dir}"> 
      <patternset includes="jdtCompilerAdapter.jar"/> 
      <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/> 
     </unzip> 
    </target> 
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler"> 
     <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/> 
     <antcall target="build"/> 
    </target> 
</project> 
+0

Android 실행 파일은 .apk 파일이며, 왜 jar 파일이 필요합니까? –

+4

다른 프로젝트에서 사용하려면 – unkown

+0

여기에 build.xml을 추가 할 수 있습니까? –

답변

26

선택 프로젝트, 그 권리를 선택 항아리에서 프로젝트를 선택 내보내기를 클릭합니다. 그런 다음 간단한 마법사를 따라 항아리를 저장할 곳을 지정하고 마칩니다. 거기에 항아리가 있습니다. enter image description here

+0

ur 귀중한 도움을 주셔서 감사합니다 – unkown

+0

@lenda : 언제든지 도와 드리겠습니다. :) – YuDroid

+19

** 대안 **. ** 프로젝트를 라이브러리 프로젝트로 표시하면 자동으로 jar 파일이 생성됩니다 **. 프로젝트 선택 속성에서 마우스 오른쪽 버튼을 클릭하고 왼쪽에서 Android를 선택한 다음 "Is Library"를 선택하여 프로젝트를 라이브러리 프로젝트로 만들 수 있습니다. 그런 다음 bin 폴더를 확인하십시오. 항아리가 없으면 프로젝트를 청소하고 빌드하십시오. – saji159

1

단계 1. 설명한대로 Android 라이브러리 프로젝트를 만듭니다. here.

2 단계. 이제 1 단계에서 만든 Android 라이브러리 프로젝트에 대한 참조를 클라이언트 응용 프로그램에 제공해야합니다. 그렇게하는 데는 두 가지 방법이 있습니다.

• 클라이언트 응용 프로그램 안드로이드 도서관 프로젝트 자체의 기준을 부여 부동산 - 왼쪽 창에서> 선택 '안드로이드'-> Libraty 섹션에서, (이것은 위의 1 단계 에 주어진 링크에서 설명) 안드로이드 Libraty 프로젝트를 추가

• Android 라이브러리 프로젝트 (Android 라이브러리 프로젝트의 위치 -> bin -> .jar 파일)의 .jar 파일에 대한 참조를 제공하십시오. 클라이언트 응용 프로그램 -> 등록 정보 -> lefe 창의 'Java Build Path'를 클릭하십시오 - '라이브러리'탭으로 이동 - '외부 JAR 추가'버튼을 클릭하고 .jar 파일 선택 -> '주문 및 내보내기'로 이동하십시오. '탭을 클릭하고 .jar 파일 참조를 선택하여 맨 위로 이동하십시오.

희망이 도움이 될 것입니다.

관련 문제