I got this error while trying to generate the signed APK. The thing is, my app is able to run and debug normally on my device. I don't know why when I try to generate APK, this error came out. How to ignore this error and generate the signed APK? I am using Android Studio 1.2.1.1 for Mac.
Traditionally, a Fragment instance could only be instantiated using its default empty constructor. This is because the system would need to reinitialize it under certain circumstances like configuration changes and the app's process recreation.
The correct way to instantiate a new fragment and passing values to it, is by creating a bundle, setting arguments on this bundle and then passing it to our fragment. Inside the fragment we then retrieve this bundle and get the values out of it. A clean way to do this is by creating a so called “factory method”.
Found the solution. The easier way is to add these to the gradle:
android { lintOptions { checkReleaseBuilds false } }
Or another way is to add @SuppressLint("ValidFragment")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With