Android Studio cannot resolve R in imported project?

后端 未结 30 2254
名媛妹妹
名媛妹妹 2020-11-30 02:27

I\'m trying the new Android Studio. I\'ve exported a project from eclipse, using the build gradle option. I\'ve then imported it in Android Studio. The R.java file under gen

30条回答
  •  萌比男神i
    2020-11-30 02:46

    In my case (Linux, Android Studio 0.8.6 ) the following helps :

    File > Project Structure > Modules > select main module > select its facet > Generated Sources

    change value of "Directory for generated files:"

    from

    MY_PATH/.idea/gen
    

    to

    MY_PATH/gen
    

    Without that code is compiled, apk is build and run successfully

    but Android Studio editor highlights mypackage.R.anything as "cannot resolve" in all sub-packages classes

提交回复
热议问题