Skip to content

Android Build failed with Java compilation Error #1005

Description

@michele-l

Bug report

Summary

When building for Android, i get "Java compilation error" with the following error:

[app path]\node_modules\@react-native-community\datetimepicker\android\src\main\java\com\reactcommunity\rndatetimepicker\RNDateTimePickerPackage.java:23: error: cannot find symbol`
`    } else if (name.equals(MaterialDatePickerModule.NAME)) {`
`                           ^`
`  symbol:   variable MaterialDatePickerModule`
`  location: class RNDateTimePickerPackage`

Reproducible sample code

<DateTimePicker value={date || new Date()} mode="date" display={Platform.OS === 'ios' ? 'spinner' : 'default'} onChange={onChange} />

This is the code i use for the picker. I then just submit the value to a function. Everything works in debug (using Expo Go).

Steps to reproduce

  1. Implement the DateTimePicker

  2. Build an Android App
    Describe what you expected to happen:

  3. The app correctly builds

Environment info

Expo version 53.0.20

npx react-native info output:

System:
  OS: Windows 10 10.0.19045
  CPU: "(16) x64 AMD Ryzen 7 5700G with Radeon Graphics         "
  Memory: 11.94 GB / 23.29 GB
Binaries:
  Node:
    version: 22.18.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 8.12.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: Version     2020.3.0.0 AI-203.7717.56.2031.7678000
  Visual Studio:
    - 17.14.36127.28 (Visual Studio Community 2022)
Languages:
  Java: 17.0.12
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.1
    wanted: ^20.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.5
    wanted: 0.79.5
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

datetimepicker version: 8.4.1

iOS / Android version: Android 14

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions