Android Question [SOLVED] Build configuration + shared class module = package name issue

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
I have created an app with two build configurations (two different package names of course). I have added the AutoTextSizeLabel class for custom views added to the layout from the Designer.

When I compile the app with BC1 (the build configuration used when I created the layout), no error appears in the logs.
But when I compile the app with BC2 (the other build configuration), I get lines in the logs like the one below (one line per one custom view used).

Class not found: BC1_package.autotextsizelabel, trying: BC2_package.autotextsizelabel

I have thought that opening the layout from the Designer selecting the build configuration 2 and saving the layout again would correct the issue but it does not. I have checked and the layout file is not protected (I can save it without error, it is writable).

The layout works great and without error but I wonder what I did wrong. Do you have any idea ? Many thanks
 

DonManfred

Expert
Licensed User
Longtime User
As far as i know the actual packagename is used when adding a view to the layout. Maybe always the "default" Packagename (first in the build configs?) is used...

Dont know if it works when you use two layouts!?
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello Manfred,
Thanks a lot for your reply and clear explanation. I had to use two different layouts to make this to work. But it was quite easy thanks to Erel who eased the operation by allowing us to select multiple views and affect them the custom view's class in one operation only. :)
 
Upvote 0
Top