"meaning of life" is preceded by "the", and is considered to be a single specific thing.
"Philosophy is an attempt to construct a viable hypothesis to explain the meaning of life."
"meaning in life" is non-specific and uncountable, and is not preceded by "the". You can precede it with "some" or "any" in many cases.
Student or Learner