Android Studio don't generate R.java for my import project

后端 未结 23 1684
天命终不由人
天命终不由人 2020-12-29 04:20

I import a project to Android Studio , but the R.java is always empty.

public final class R {
}

I have tried:

  1. Make project,ma
23条回答
  •  情话喂你
    2020-12-29 04:25

    I had a similar problem in a large multi-module project with many dependencies among the modules. What worked for me, was to attempt to build separately from command line all the modules that failed to build within Android Studio. That gave me indications on resources missing in each project. From the project level in my console I did:

    $ cd moduleName
    $ ../gradlew assembleDebug
    

    This provided me with a number of 'No resource found that matches the given name' errors, that weren't shown before, when I build the project as a whole.

提交回复
热议问题