Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing from eclipse to android studio?

I wanted to import some projects from Eclipse to Android Studio, I've already used the option where you export it as a .gradle file and open it in the Studio. But I also tried a method where I create a new project in Studio and the copy the main_activity.java and the important files in the res folder. But then when I open the main_activity.java, it immediatly gives me an error. Could not resolve R I've already searched for an answer and somebody came up with adding import android.R; or import com.example.package; the first one works for the 'R' issue but then Gives me an error in which it says that setContentView cannot be resolved. And the second line doesn't do anything.

like image 469
The Dutchman Avatar asked May 10 '26 09:05

The Dutchman


1 Answers

I faced that problem too, Do the following things,

  1. do update your ADT to r22,
  2. get update of r22 in ADT,
  3. Close your project from File-Close Project
  4. Exit from Studio,
  5. Launch Studio again,
  6. Select your project from recent projects which are displayed in left panel of Home
like image 192
Rahul Upadhyay Avatar answered May 11 '26 21:05

Rahul Upadhyay