Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:7:190

But when He gives them a good ˹child˺, they ascribe partners to Him concerning that which He has given them. Exalted is Allah above what they associate with Him.  

But when He gave them a sound one, ˹a sound˺ child, they ascribed to Him associates (shurakā’a: a variant reading has shirkan, meaning sharīkan, ‘an associate’) in that which He had given them, by naming it ‘Abd al-Hārith, ‘servant of al-Hārith’, when it is not right to be a ‘servant’ (‘abd) of any one but ‘God’ ˹sc. ‘Abd Allāh˺, but this ˹namesake ‘Abd˺ is not an association ˹of another with God˺ in terms of servitude, for Adam was immune ˹from a sin such as associating others in worship with God˺. Samura ˹b. Jundub˺ reported that the Prophet (s) said, ‘On one occasion when Eve gave birth — all the children she bore had failed to survive — Satan visited her and said ˹to her˺, “Name it ˹the child˺ ‘Abd al-Hārith, and it will live.” She named it so and it lived. This ˹affair˺ was the result of Satan’s inspiration and his doings’: reported by al-Hākim, who deemed it ˹the report˺ ‘sound’ (sahīh), and ˹also reported˺ by al-Tirmidhī, who considered it ‘fair-uncommon’ (hasan gharīb); but exalted is God above what they, the people of Mecca, associate, in the way of idols (this sentence is consequent, a supplement to ˹the one beginning with˺ khalaqakum, ‘He created you’, so that what comes between the two is a parenthetical statement).
القرآن:٧:١٩٠

فَلَمَّا آتَاهُمَا صَالِحًا جَعَلَا لَهُ شُرَكَاءَ فِيمَا آتَاهُمَا ۚ فَتَعَالَى اللَّهُ عَمَّا يُشْرِكُونَ  

{فلمَّا آتاهما} ولدا {صالحا جعلا له شركاء} وفي قراءة بكسر الشين والتنوين أي شريكا {فيما آتاهما} بتسميته عبد الحارث ولا ينبغي أن يكون عبدا إلا لله، وليس بإشراك في العبودية لعصمة آدم وروى سمرة عن النبي ﷺ قال: لما ولدت حواء طاف بها إبليس وكان لا يعيش لها ولد فقال: سميه عبد الحارث فإنه يعيش فسمته فعاش فكان ذلك من وحي الشيطان وأمره رواه الحاكم وقال صحيح والترمذي وقال حسن غريب {فتعالى الله عما يشركون} أي أهل مكة به من الأصنام، والجملة مسببة عطف على خلقكم وما بينهما اعتراض.