안드로이드 MyFacebookApp 프로젝트 1

안드로이드 MyFacebookApp 프로젝트

1 사전 작업

2 페이스북 앱아이디 발급

  • App ID와 App Secret을 발급받는다.

3 새 프로젝트

이번에는 샘플 대신 새 프로젝트를 만들어 보자.

  • File --- New --- Android Application Project
  • "New Android Application" --- Application Name: My Facebook App[1] --- [Next >]
  • "Configure Project" --- [Next >]
  • "Configure Launcher Icon" --- [Next >]
  • "Create Activity"[2] --- [Next >]
  • "New Blank Activity" --- [Finish]

FacebookSDK를 라이브러리로 지정

  • Package Explorer --- MyFacebookApp 우클릭 --- Properties
  • "Properties for MyFacebookApp" --- Android --- "Library" --- [Add...]
  • "Project Selection" --- FacebookSDK 선택 --- [OK]
  • [OK]

그러면 Problems 창과 Console 창에 오류메시지가 나타난다.

Problems
Jar mismatch! Fix your dependencies	MyFacebookApp		Unknown	Android
Console
[2013-01-13 11:33:31 - MyFacebookApp] Found 2 versions of android-support-v4.jar in the dependency list,
[2013-01-13 11:33:31 - MyFacebookApp] but not all the versions are identical (check is based on SHA-1 only at this time).
[2013-01-13 11:33:31 - MyFacebookApp] All versions of the libraries must be the same at this time.
[2013-01-13 11:33:31 - MyFacebookApp] Versions found are:
[2013-01-13 11:33:31 - MyFacebookApp] Path: D:\workspace\adt\MyFacebookApp\libs\android-support-v4.jar
[2013-01-13 11:33:31 - MyFacebookApp] 	Length: 385685
[2013-01-13 11:33:31 - MyFacebookApp] 	SHA-1: 43c34bc56de78901f234567890123a4567bc890d
[2013-01-13 11:33:31 - MyFacebookApp] Path: D:\workspace\adt\FacebookSDK\libs\android-support-v4.jar
[2013-01-13 11:33:31 - MyFacebookApp] 	Length: 349252
[2013-01-13 11:33:31 - MyFacebookApp] 	SHA-1: 612345c6789012a345b678901a72bc3de890f123
[2013-01-13 11:33:31 - MyFacebookApp] Jar mismatch! Fix your dependencies
→ FacebookSDK와 MyFacebookApp 둘다 android-support-v4.jar를 가지고 있어서 충돌이 나는 것이다.
→ 어느 한쪽을 제거해주면 된다.
  • Package Explorer --- MyFacebookApp --- libs --- android-support-v4.jar 우클릭 --- Delete
  • "Confirm Delete" --- [OK]

이제 오류가 사라졌다. 실행시켜보자.

  • Package Explorer --- MyFacebookApp 우클릭 --- Run as --- 1 Android Application

정상적으로 실행된다.

4 같이 보기

5 주석

  1. 앱 이름만 입력하면 프로젝트명과 패키지명은 자동으로 채워진다.
  2. BlankActivity가 기본값

6 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}