Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android xml in app cannot find custom view in module

Sorry for the dumb question, I'm doing one module for many app.

I create a custom view class in the my module (public class CustomView extends FrameLayout).

I have imported this modules into app and class in the app can call my custom view, but xml cannot call my custom view (compile project(':mymodule')).

I have not found a solution, thank all the help.

like image 410
Cver Avatar asked Oct 29 '22 17:10

Cver


1 Answers

Make sure that your module gradle has a same compileSdkVersion, buildToolsVersion as your app gradle. Also it might be beneficial to ensure that you are using same support libraries. if compileSdkVersion, buildToolsVersion is set properly you should not have any issues to find you custom view in your xml file (in case if you did not, try to use you application context in xml)

like image 162
Alexandr Kotikov Avatar answered Nov 11 '22 12:11

Alexandr Kotikov