Eclipse에서 Android Studio 프로젝트를 어떻게 여나요?
새로운 Android Studio는 더 나은 도구로 더 나은 Android 개발을 가능하게합니다. 이클립스 프로젝트를 안드로이드 스튜디오로 전송하는 방법에 대한 많은 질문을 보았지만 다른 방법은 어떻습니까?
Android Studio에서 Android 앱을 만든 경우 Eclipse로 다시 가져올 수 있습니까? 그렇다면 어떻게?
이것은 Blackberry Android 플러그인과 같은 특정 eclipse 플러그인에 필요합니다.
감사합니다.
불가능합니다. ADT에서 Gradle 기반 프로젝트에 대한 지원을 추가 할 계획이지만 현재는 불가능합니다.
프로젝트를 직접 가져올 수는 없지만 달성하기 어렵지는 않습니다.
- Eclipse에서 새 Android 빈 프로젝트 만들기
- 새로운 res / 폴더와 AndroidManifest.xml 파일을 Android Studio 프로젝트의 파일로 덮어 씁니다.
- Eclipse src 폴더에 Android Studio 프로젝트 (com / example / app /과 같은 패키지 이름 폴더 구조 및 Java 파일을 포함해야 함)에서 java / 폴더의 내용을 복사합니다.
- 필요한 경우 필요한 라이브러리 연결
기본적으로 Android 애플리케이션의 기본 요소는 Java 파일, 매니페스트 파일 및 리소스입니다. 거기에서 좋아하는 IDE에서 프로젝트를 다시 빌드 할 수 있습니다.
Android Studio 프로젝트를 Eclipse로 가져 오는 단계별 프로세스 ...
마법사를 사용하여 Eclipse에서 새 Android 프로젝트를 시작하고 app / build.gradle에서 다음 세부 정보를 채 웁니다.
ApplicationName 및 ProjectName :-/ folder PackageName : MinSDK, TargetSDK 및 CompileSDK의 .iml 파일에서 프로젝트 이름을 찾을 수 있습니다.
마법사에서 다음을 클릭하고 ' 활동 만들기 '및 ' 사용자 지정 아이콘 만들기 '를 "선택 취소"했는지 확인합니다 . 마침을 클릭합니다.
새로 생성 된 프로젝트에서 AndroidManifest.xml 파일을 엽니 다. app / src / main / AndroidManifest.xml에서 "application", "uses-permission" 등 태그를 그대로 복사합니다.
소스 파일 : AndroidStudio / app / src / main / java의 모든 콘텐츠를 Eclipse // src 폴더로 바꿉니다.
리소스 파일 : AndroidStudio / app / src / main / res의 모든 콘텐츠를 Eclipse // res 폴더로 바꿉니다.
라이브러리 파일 : AndroidStudio / app / libs의 모든 libs를 Eclipse // libs 폴더로 복사합니다.
Dependency Library : Properties-> Android-> Library-> Add를 사용하여 AppCompact를 종속 라이브러리로 가져 오기 및 추가
빌드 할 오류를 해결하십시오. 마지막 단계로 정리하고 다시 빌드하십시오.
휴대폰에 직접 배포 할 수는 없지만 bin 폴더에서 생성 된 .apk 파일을 찾을 수 있습니다.
업데이트 : Eclipse 및 Android Studio 용 Android 프로젝트 1 개 참조
현재 Android Studio에서 Android 프로젝트를 만드는 경우 Eclipse에서 열기가 어려울 것입니다. (그러나 build.gradle
Android Studio에 추가 된 클래식 Android를 여는 것이 더 쉬울 것입니다.)
따라서 (일반 프로젝트로) 열고 일부 모듈을 Eclipse 프로젝트로 변환 할 수 있지만 여전히 완전히 작동하지는 않습니다 (하지만 내부의 빠른보기로 충분할 수 있음).
에서 안드로이드 프로젝트를 이클립스와 IntelliJ에 프로젝트 파일을 생성 할 수 Gradle을 사용하는 방법
Android 팀의 문제 57668 에서 답변 됨 ( @arcone 에서 제기)
프로젝트 멤버 # 2 x ... @ android.com
eclipse 플러그인은 Android 플러그인과 호환되지 않습니다.
Eclipse의 기본 Gradle 지원을 사용하여 Android Gradle 프로젝트를 Eclipse로 가져올 수 없습니다.
Eclipse에서 작동하려면 IntelliJ에서 Gradle 지원을 수정하는 것과 같은 방식으로 Eclipse 용 Gradle 플러그인을 변경해야합니다.
그것은 Android 팀이 IntelliJ 용 gradle 플러그인을 작업하고 있으며 Eclipse 용 gradle 플러그인도 업데이트해야합니다.
지금 이클립스로 가능한 것은
이것은 구식 입니다. Eclipse에서 Android Studio 프로젝트를 가져 오는 방법을 참조하십시오 .
.1. 프로젝트를 일반 프로젝트로 가져 오기
.project
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>OpenSpritz-Android</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
.2. 2 Eclipse를 넣으십시오. 에 모듈에 "점"파일 /OpenSpritz-Android/app/src/main
및/OpenSpritz-Android/lib/src/main
.project
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>OpenSpritz-Android-app</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
.classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="java"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
.삼. 기존 Android 코드로 작업 공간에 가져 오기
그런 다음 익숙한 방법으로 코드를 탐색 할 수 있지만 그 후에도 Eclipse ADT로 실행할 수 없습니다.
.4.
이제 gradle
CLI 또는 Eclipse 용 Nodeclipse / Enide Gradle ( marketplace )을 사용 하여 빌드 및 작업을 실행할 수 있습니다.
https://github.com/Nodeclipse/nodeclipse-1/issues/148 에서 토론 하십시오.
Eclipse에서 가져온 gradle android 프로젝트를 실행할 수 없음 에서도 답변했습니다.
프로젝트 가져 오기> 속성> 자바 빌드 경로> 소스 탭 .... src에 대한 경로 제거 .... add folde rbutton을 사용하여 소스 코드의 자바 폴더에 경로를 추가 한 다음 평소와 같이 프로젝트를 빌드합니다.
많은 수작업 없이는 안드로이드 스튜디오 프로젝트를 이클립스로 가져올 수 없다고 생각합니다.
I really miss the automatic build feature in Eclipse but also hate the speed and bugs in Eclipse for Mac. It would be nice to have the best of both worlds. The project layout in Eclipse and Android Studio has a lot in difference and I guess it would be very difficult if not impossible to change the default layout. Therefore, I tried to create an empty Android project in Eclipse. Then I deleted the physical folders and files and created linked resources to reference those in the Android Studio project and voila! It works.
Here is my resource mapping:
AS-Project/app/src/main/AndroidManifest.xml -> Eclipse-Project/AndroidManifest.xml
AS-Project/app/src/main/res -> Eclipse-Project/res
AS-Project/app/src/main/assets -> Eclipse-Project/assets
AS-Project/app/src/main/java -> Eclipse-Project/src
AS-Project/app/libs -> Eclipse-Project/libs-as
Linked folder doesn't quite work for the "libs" folder. So I mapped it to a folder called "libs-as" and manually added the JARs to project build path. In the worst case I guess you could maintain two separate libs folders.
P.S. It would be a good idea to put two projects side by side and use location variables to reference relative paths (e.g. ${PARENT-1-PROJECT_LOC})
The published answer worked for me, but only after some mis-steps due to my inexperience with these IDEs. For any other beginner be careful with these ...
- use the same minimum, target and build SDKs
- use the exact same project name, and watch the sequence of project directories based on the package name, for the correct location of the .java file[s]
- for the /res folder copy over missing directories
- edit [i used NotePad] all matching xml files, carefully choosing the correct mix of entries, some from each
After this there may still be some errors to contend with, but with some persistence you should be able to correct them.
I just published a project that requires to work for Android Studio or Eclipse users. It's basically an Android Studio project, but I provided a gradle build file that developers can use to convert it to Eclipse.
Basically developers would have to run the following command to convert the project to Eclipse:
gradle -b eclipse.gradle eclipse
Here are the contents of eclipse.gradle:
apply plugin: 'java'
apply plugin: 'eclipse'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
// Add the natures and build commands to the project
eclipse.project {
natures 'com.android.ide.eclipse.adt.AndroidNature'
natures 'org.eclipse.jdt.core.javanature'
buildCommands.clear();
buildCommand 'com.android.ide.eclipse.adt.ResourceManagerBuilder'
buildCommand 'com.android.ide.eclipse.adt.PreCompilerBuilder'
buildCommand 'org.eclipse.jdt.core.javabuilder'
buildCommand 'com.android.ide.eclipse.adt.ApkBuilder'
}
// The source code is in the java folder
sourceSets.main.java.srcDirs 'java'
dependencies {
// declare your dependencies here
}
Hope this helps
Adding step-by-step procedure. 1. Install gradle. Note that if you have Android Studio you already have gradle. 2. Create an eclipse.gradle file in the root folder of your Android Studio project and copy the contents of the eclipse.gradle mentioned above. 3. Open a command prompt or terminal and run gradle -b eclipse.gradle 4. Try to open in Eclipse
It's quite simple if you know the trick.
Replace the eclipse project Res folder with Android studio project's res folder.
Go inside java folder and copy all folders and paste inside src folder of eclipse project.
Open Android manifest of android studio project, copy all of the content and paste it in eclipse projects manifest.
clean and run the project.
Simple way to move project from android studio to eclipse.
1) Import project in eclipse .There is no file in src folder in these project.
2) Go to the java folder that is available in folder stucture which you imported in eclipse. Copy the folder which is inside java it would be most of the time started from 'com' and paste in source 'src' folder .
Now you can compile your projrct it would work. if your project require third party libs then add the required file also.
참고 URL : https://stackoverflow.com/questions/16745793/how-do-you-open-an-android-studio-project-in-eclipse
'IT박스' 카테고리의 다른 글
C ++ 열거 형의 최대 값 및 최소값 (0) | 2020.10.17 |
---|---|
Wix는 모든 사용자 / 컴퓨터 당 광고되지 않은 바로 가기 생성 (0) | 2020.10.17 |
유지 관리를 위해 사이트가 다운되었을 때 보낼 올바른 HTTP 상태 코드는 무엇입니까? (0) | 2020.10.17 |
JAXP와 JAXB의 차이점은 무엇입니까? (0) | 2020.10.17 |
Mac OS X 용 멋진 dmg "설치 프로그램"만들기 (0) | 2020.10.17 |