Developing for Android in Eclipse: R.java not regenerating

前端 未结 30 3148
孤城傲影
孤城傲影 2020-11-21 07:04

I\'ve found out that my R.java is never updated, so it doesn\'t contain information about my new resources, so I decided to delete it and thought that Eclipse would generate

30条回答
  •  一生所求
    2020-11-21 08:01

    Quick fix:

    The package name in the manifest needs to be the same as the one in the /src folder, the /gen folder package will be automatically reproduced.

    Detailed observation:

    Observe the name of package in the /gen folder. In my case it was different than the one in the /src folder.

    The package referenced in the manifest was that of the /gen folder.

    I attempted to add a package with the name of the /src folder to the /gen folder too see what would've happened, but this did not solve the issue. I proceeded then to remove the package name that was not the same as the package name of the /src folder. This package with the name that did not correspond to the /src folder was recreated as soon as I removed it.

    Since the package reference in the manifest corresponded to the one that was being senselessly recreated and that did not correspond with the package in the /src folder, this prompted to rename package = "oldPackage" with the package = "srcFolderPackage".

提交回复
热议问题