0

I wanted just to learn how export and import works in Eclispe before sending the Android projects to other person.

The project works fine, contains 3 folders appcompat_v7, busTracker, and google-play-services_lib, has the following SDK Location D:\andriod_sdk. I exported the folders by performing the following steps:

Selected the 3 directories → Export → General, Archive File → provide the path → Finish.

Next, I imported the exported project into new Eclipse workspace by doing the following:

File → Import → General → Existing Projects into Workspace → Next → Select archive file → Finish.

But I am getting to many errors in the new Eclispe workspace, I think it does not recognize the SDK Location. Please see the screensht below.

I verified the SDK Location in the new Eclipse workspace (where I have imprted the exported folders) by performing the following steps Window → Preferences → Android → SDK Location. And there I have the same SDK path D:\andriod_sdk of the orginal project.

enter image description here

Mr Asker
  • 2,300
  • 11
  • 31
  • 56

1 Answers1

0

It does not sound like you imported the library right... Check your build tools version and do as below:

1. ANDROID SDK BUILD TOOLS LOWER THAN 22.1.0

In eclipse you need to right click on the project, go to Properties, select Android in the list then Add to add the library

Follow this tutorial in the docs: http://developer.android.com/tools/support-library/setup.html


2. ANDROID SDK TOOLS HIGHER THAN 22.1.0

Since the version 22.1.0, the class ActionBarActivity is deprecated, so instead use AppCompatActivity. For more details see here

1 - Make sure library project(appcompat_v7) is open & is proper referenced (added as library) in your application project.

2 - Delete android-support-v4.jar from your project's libs folder(if jar is present).

3 - Appcompat_v7 must have android-support-v4.jar & android-support-v7-appcompat.jar inside it's libs folder. (If jars are not present copy them from /sdk/extras/android/support/v7/appcompat/libs folder of your installed android sdk location)

4- Check whether ActionBarActivity is properly imported.

import android.support.v7.app.ActionBarActivity;
  1. IF ABOVE SOLUTIONS NOT WORK

(From: ActionBarActivity cannot be resolved to a type, Jar mismatch : Eclipse):

Deleting the jar file in work space will do the trick

     projectname>libs>android-support-v4

and go to

     appcompat_v7>libs>android-support-v4

copy this file and paste it in your project This process will help you bypass all the errors regarding this issue

Hope it help

Community
  • 1
  • 1
piotrek1543
  • 19,130
  • 7
  • 81
  • 94