在eclipse中已经定义的R类型

时间:2022-11-06 18:58:39

I know that the problem has already been investigated before but the given solutions didn't work with me.

我知道这个问题已经被调查过了,但是给出的解决方案对我不起作用。

I Have an android project using some libraries. I added today the BaseGameUtils one. My problem : I can't build my project because it contains an error : Type R is already defined (error spotted in com.google.example.games.gamebaseutils)

我有一个使用一些库的android项目。我今天加入了BaseGameUtils。我的问题是:我无法构建我的项目,因为它包含一个错误:类型R已经定义(在com.google.example.games.gamebaseutils中发现错误)

I tried what everyone describes as a miracle solution : disabling Java builder then deleting the R file. The app launches but none of the changes made in my code are taken in count (normal, no java builder enabled...)

我尝试了每个人都称之为奇迹的解决方案:禁用Java builder,然后删除R文件。应用程序启动,但在我的代码中所做的更改都没有进行计数(正常,没有启用java构建器…)

fyi, here is my packages list in gen folder :

fyi,这是我的包列表在gen文件夹里:

com.vending.billing
>InAppBillingService.java

com.google.android.gms
>R.java

com.google.example.games.gamebaseutils
>R.java <=The error appears to be in this file

my.bundle.name
>R.java

Does someone have a real solution to fix that ?

有人有真正的解决办法吗?

1 个解决方案

#1


0  

I have solved this problem by changing the library's package name to another one, supposing that it was a R.java file path conflict problem between my imported libraries.

我通过将库的包名改为另一个包名来解决这个问题,假设它是一个R。我导入的库之间的java文件路径冲突问题。

Everything works fine now.

现在,一切工作正常。

#1


0  

I have solved this problem by changing the library's package name to another one, supposing that it was a R.java file path conflict problem between my imported libraries.

我通过将库的包名改为另一个包名来解决这个问题,假设它是一个R。我导入的库之间的java文件路径冲突问题。

Everything works fine now.

现在,一切工作正常。