Initialize location entity

Hi there
how i can initialize location entity for develop dynamic functions for ex: voice comand or notifications with concatenation.
i try develop one function but the app crashes beacuse the location entity was not initialized.
help me plaese
best regard