I have updated my android studio from 3.5.x to 3.6 today and getting error while generating signed apk for build variant showing the follow
It happen when you used auto viewBinding, Binding using Kotlin or viewBinding feature of 3.6.
In case, you are adding files whose element share same id's, ViewBinding confuse and create such error.
Let me help you by example Adapter class which have two layout file separating by view Type :
import kotlinx.android.synthetic.main.frag_subscription_recommend.view.*
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(parent.context).inflate(
if (viewType == 1) {
R.layout.frag_subscription_recommend
} else
R.layout.frag_subscription_common,
parent,
false
)
)
}
onBinding(){
holder.itemView.id_button_submit.setOnClickListener {}
}
// which in case confusing which resource or layout full fill the requirement bcoz both have same ids of button. in case you have to use :
onBinding(){
holder.itemView.findViewById
which enable the old implementation.
Let me know if this working on your side?