How should we treat this ( seeming ) contradiction in John's first letter?
First of all: I think that when John, in the first passage, says that we 'call Him ( God ) a liar' if we say that we have no sin, and that if we 'confess our sin, He is faithful and just to forgive us our sin and to cleanse us from all unrighteousness'; he is not speaking of those whom God has already forgiven and cleansed, those who have been clothed with the righteousness of Christ ( become 'in' Christ ), but rather, in historical context, to those who 'say they are Jews, but are not', those who trusted in their own 'righteousness' ( Isa. 64:6 ) and even today, of the un-repentant unbeliever.
Secondly; I think that John is speaking of the deadly spiritual sin, the rejection of the Holy Spirit of Christ, the sin that will 'not be forgiven, not in this age or in the age to come' ( Jesus is speaking, respectively, of the Old and New Covenant 'ages' ); rather than the physical sin that Paul speaks of, in his letter to the Romans ( Romans 7 ), among other passages.
In the second passage from John's first letter, that we are looking at here; I think that he is speaking of those who are children of God ( have become 'in' Christ ), having been 'clothed' with the righteousness of Christ, and thus cannot commit the deadly spiritual sin of rejection of, and blasphemy against, the Holy Spirit of Christ, that Jesus Himself spoke of, in Matthew 12. It is obvious to me, and I'm sure to my readers as well, that Christians ( those who have been 'born of God' ) still commit sin in their physical bodies, and anyone who denies that they still sin 'makes God a liar, and the truth is not in him', but is only deceiving ( fooling ) himself.
The only other option that we have here, is that he who still sins ( in the flesh ), has not been born of God, and that we will not be truly 'born of God' until we die physically ( I believe that some actually teach this! )! I don't know about you; but I'd rather say that, although we still sin ( in the flesh ): we have been 'covered' by the blood of Christ ( His righteousness ), thus becoming 'in' Christ, and unable to commit the spiritual sin of rejection of Him and of His Holy Spirit!
In his letter to the Romans ( Romans 6 ); Paul says that we have indeed died ( to sin ), having been 'crucified with Him' and 'buried with Him'. He told them that they should reckon themselves 'dead to sin, but alive to God'. In the next few verses ( 12-15 ) he agrees with John by saying that, even though they were dead to sin, and were 'crucified with Him ( Christ )', they ( and we ) needed to make sure that they did 'not let sin reign' in their ( our ) mortal bodies, but, as he said later in his letter ( Romans 12:1 ), that we should present our 'bodies a living sacrifice to God, which is your ( our ) reasonable sacrifice'. In verse 14, Paul seemingly contradicts himself ( verse 12 ) by saying that 'sin shall not have dominion over you', not, as previously, that we are 'not to let sin reign' in our mortal bodies, but now tells us ( verse 14 ) that 'sin shall NOT have dominion' over us: and why? Because we are 'no longer under Law ( the letter ), but under grace ( the Spirit )'!
Paul begins to wrap up his thoughts, in the next paragraph, by asking the same question that he began this part of his letter with: 'Shall we sin because we are not under law, but under grace?'
The answer obviously is, 'Certainly not!'
Another way to state this question, in terminology that I've already used, is; 'since we are 'covered' by the blood, or Christ's righteousness, and no longer capable of the spiritually deadly sin of rejection, and blasphemy of the Holy Spirit of Christ: should we continue to sin in the flesh since we are 'covered'?'
Paul, in his letters; while realizing ( acknowledging ) God as Sovereign, also realizes that man is responsible for his actions in the flesh. James also realizes this, later, in his letter; when he observes that 'faith without works is dead'. Although 'sin shall ( will ) not have dominion' over us, we still are responsible, in actuality , to 'not let sin reign' in our mortal bodies. James tell those who would claim to have faith without 'working' it out in their lives ( Romans 12:1 ), that their 'faith' is no faith at all, but a 'useless' blind trust in the letter of the law, and not the Spirit thereof, which 'gives life'!
I know that this is a 'hard' study, in many ways, and many, I think, hopelessly 'wrangle' it 'to their own destruction' ( not, I hope, in the spiritual sense, but in a purely physical sense ); but my hope is that this little study, along with a deeper spiritual understanding, will help those to see that it is because of God's Sovereignty, not in spite of it, that we can and should ( in other words are responsible to ) 'work out' our salvation by not letting 'sin reign' over our mortal bodies!
In God's Kingdom,
and 'under' His grace,