1 Timothy 6:16 "Who only hath immortality, dwelling in the light which no man can approach unto; whom no man hath seen, nor can see: to whom be honour and power everlasting. Amen."
1 Kings 8:12 "Then spake Solomon, The LORD said that he would dwell in the thick darkness."
These two scriptures appear contradictory when read and understood as being references to the very same thing in a literal sense. However, this does not have to be the case.
The truth expressed in 1Ti 6:16 is that God dwells in a light which is so bright that not mortal man can approach to, and the implication really is "approach to and live" (cp. Exodus 33:20 - "And he said, Thou canst not see my face: for there shall no man see me, and live.") The glory and light surrounding or emanating from God is so bright and powerful that man cannot be exposed to it and or approach it.
Thus, God when He chose to reveal Himself among man, always had to chose a manner which would "cover" this brightness and light. This then is what we can read of in those places where it is mentioned that God would dwell in "thick darkness" which in 1Ki 8:12 is a reference to "the cloud" which was manifested as filling the Temple (cp. v. 10). The same is mentioned in reference to God's dwelling in the tabernacle in the wilderness where God dwelled in a "dark place", the most holy place of the tabernacle which did not have any artificial or natural light to illumine it, but rather was "a dark place". Also, the use of "dark place" or "thick darkness" is an idiomatic way of describing secrecy, in that God's dwelling place is secluded and removed from man's prying eyes.
There are no contradictions between these passages, rather both statements about God dwelling in the light and God dwelling in a dark place are true but in a different way each. Also, we should not that in both cases the truth about God's unsearchableness or unapproachableness is emphatically communicated.