question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android build failure with v2.2.0 - RNDatePickerDialogFragment.java:105: error: missing return statement

See original GitHub issue

Bug

Android fails to build version 2.2.0.

> Task :@react-native-community_datetimepicker:compileReleaseJavaWithJavac FAILED /data/workspace/AndroidReactBuildNew/node_modules/@react-native-community/datetimepicker/android/src/main/java/com/reactcommunity/rndatetimepicker/RNDatePickerDialogFragment.java:105: error: missing return statement } ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error

Environment info

React native info output:

  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    @react-native-community/cli: ^1.9.5 => 1.12.0 
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.4 => 0.60.4

Library version: 2.2.0

Steps To Reproduce

Try to build.

Describe what you expected to happen:

App to build successfully.

Reproducible sample code

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:5

github_iconTop GitHub Comments

3reactions
kuwaitbinarycommented, Feb 3, 2020

I am returning null as temporary fix not ideal

/node_modules/@react-native-community/datetimepicker/android/src/main/java/com/reactcommunity/rndatetimepicker/RNDatePickerDialogFragment.java

      DatePickerDialog dialog = new RNDismissableDatePickerDialog(activityContext, onDateSetListener, year, month, day);
      switch (display) {
        case CALENDAR:
          dialog.getDatePicker().setCalendarViewShown(true);
          dialog.getDatePicker().setSpinnersShown(false);
          break;
        case SPINNER:
          dialog.getDatePicker().setCalendarViewShown(false);
          break;
      }
      return dialog;
    }
    return null; // <--- Add this
  }

Screen Shot 2020-02-03 at 11 54 52 AM
1reaction
cristianoccazinspcommented, Feb 3, 2020

How did a compile a error get past a release… Same issue here, rolling back to 2.1 until then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android build failure with v2.2.0 - GitHub
Android build failure with v2.2.0 - RNDatePickerDialogFragment.java:105: error: missing return statement #104.
Read more >
missing return statement when I run my app in Android Studio
Compilation failed ; see the compiler error output for details. I've tried to search on Google, but I couldn't find the solution. Here...
Read more >
Java Missing Return Statement - Baeldung
a return statement was simply omitted by mistake; the method doesn't return any value, but type void is not declared in the method...
Read more >
Missing Return Statement Error (Java Tutorial) - YouTube
The Java Tutorial will explain the error missing return statement and show you how to fix the error. Subscribe To Get...
Read more >
Java missing return statement - Javatpoint
The missing return statement is one of the most occurred errors in the Java program. The beginners usually face the missing return statement...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found