Yes! Without knowing the fact pattern it is impossible to advise accurately, other than to say it is a bad idea that could land the adult or 17 year old in jail!
It’s against the law in California to possess, produce or distribute “obscene matter” depicting children younger than 18. This would be a violation of PC 311, the state’s child pornography law. In cases where both parties are under 18, state courts have been known to show some leniency.
However, it could also be considered to be potentially sexual harassment.