Reputation: 359
I have an Android project in which I want to generate two versions, one paid and one with advertising. According read on Stackoverflow, one way to do this is to create a parent project and create 2 child projects who imported the parent as a library. Also I use appcompat, so the hierarchy is as follows:
The problem is that the R class does not compile due to an error, which I can not find. But when the parent project did not configure as library ("Is library unchecked") everything works fine. Here the pictures:
Hopefully you can help me, thanks in advance.
Edit: mark's answer resolved the problem with android.support.v7.appcompat.R.id.search_src_text, but I still have errors with the R class, example:
Upvotes: 1
Views: 3473
Reputation: 359
I found the problem. In fact, mark's answer solved part of the errors, but, after reading this post Resource ID In Android Library Project, solved the problem with menu id's.
Thanks.
Upvotes: 1
Reputation: 89
Sorry for my English.
Replace the error line with this:
EditText editText = (EditText) searchView.findViewById(R.id.search_src_text);
Upvotes: 2