shimohq / react-native-prompt-android

A polyfill library for Alert.prompt on Android platform, working both on Android and iOS platform.
MIT License
129 stars 74 forks source link

Android Build error #9

Closed JodiWarren closed 7 years ago

JodiWarren commented 7 years ago

My Gradle build failed with the following error:

/Users/jodi/Projects/App/node_modules/react-native-prompt-android/android/src/main/java/im/shimo/react/prompt/RNPromptFragment.java:55: Error: Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundle) instead [ValidFragment]
    public RNPromptFragment(@Nullable RNPromptModule.PromptFragmentListener listener, Bundle arguments) {
           ~~~~~~~~~~~~~~~~

   Explanation for issues of type "ValidFragment":
   From the Fragment documentation:
   Every fragment must have an empty constructor, so it can be instantiated
   when restoring its activity's state. It is strongly recommended that
   subclasses do not have other constructors with parameters, since these
   constructors will not be called when the fragment is re-instantiated;
   instead, arguments can be supplied by the caller with setArguments(Bundle)
   and later retrieved by the Fragment with getArguments().

   http://developer.android.com/reference/android/app/Fragment.html#Fragment()

1 errors, 0 warnings
:app:lintVitalRelease FAILED
greedbell commented 7 years ago

fixed: GH-19