Avatar ·

Android P में setVisibility त्रुटि: विधि को केवल उसी लाइब्रेरी ग्रुप से कॉल किया जा सकता है

सभी को नमस्ते! मैं Android के लिए Kotlin में एक ऐप डेवलप कर रहा हूँ और Android 9 (Pie) पर `VisibilityAwareImageButton` बटन को छिपाने या दिखाने की कोशिश करते समय एक बहुत ही अजीब त्रुटि का सामना करना पड़ा।\n\nमेरे पास एक सरल कोड स्निपेट है:\n\n```kotlin\nclass MyFragment : Fragment() {\n private lateinit var myButton: VisibilityAwareImageButton\n\n override fun onViewCreated(view: View, savedInstanceState: Bundle?) {\n super.onViewCreated(view, savedInstanceState)\n myButton = view.findViewById(R.id.my_button)\n // बटन को छिपाने की कोशिश कर रहा हूँ\n myButton.visibility = View.GONE\n }\n}\n```\n\nAndroid 9 (API 28) पर चलाने पर मुझे यह अपवाद मिलता है:\n\n```\njava.lang.RuntimeException: VisibilityAwareImageButton.setVisibility can only be called from the same library group (groupI