skip to Main Content

My React Native application is unable to execute the npx react-native run-android command, consistently returning an error related to some ._filename file, which is automatically created by the system. Is there a way to make Gradlew ignore ._filename files during the build process?

My stacktrace:

ERROR:/project/path/node_modules/@react-native-firebase/app/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar: D8: com.android.tools.r8.internal.sd: Invalid classfile header
com.android.tools.r8.internal.sd: Unexpected class file name: com/learnium/RNDeviceInfo/._BuildConfig.class
    at com.android.tools.r8.internal.ug.w(R8_4.0.48_320a4fe2564c68ad8fe4492fea65872bc8f51e21c4d46e3dbac43afcc38d90de:1180)
(...)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:dexBuilderDebug'.
> Unexpected class file name: com/learnium/RNDeviceInfo/._BuildConfig.class

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 15s

I’ve already used the dot_clean . command to delete the files generated by the operating system, but at this moment, they are being recreated during the build. The error above still occurs even after running the dot_clean . command in my repository.

2

Answers


  1. Chosen as BEST ANSWER

    Apparently, the issue lies in the latest version of Android Studio Giraffe. On another iMac, I'm using Android Studio Dolphin, and it's working fine, and this error doesn't occur.

    Is anyone else experiencing issues with Android Studio Giraffe?


  2. You can try to clean your android project by:

    1. cd {projectname}/android
    2. Run ./gradlew clean

    This fixes most of the issues with gradle or any missing config files from android folder.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search