Just after some advice.
What is the best approach to wrap a library that requires R.java without causing "already added" exceptions?
Thanks
- Im wrapping an open source library which contains resources. The original library is an Android Studio project.
- The library source code contains references to R and wont compile without R.java.
- I've used thedesolatesoul's R generator tool to generate R.java and am able to compile the library. As far as I know the R.java is in the correct package etc.
- However when I include the resources in B4A using #AdditionalRes I get an "java.lang.IllegalArgumentException: already added:" exception pointing to the library resources as the issue.
- If I dont include the #AdditionalRes statement then the project compiles but throws an error saying resource not found.
- As a work around (see here) I renamed R.java to RX.java and updated any library source code reference to reflect this. This works great and the library works as expected.
What is the best approach to wrap a library that requires R.java without causing "already added" exceptions?
Thanks
Last edited: