react-native-mmkv icon indicating copy to clipboard operation
react-native-mmkv copied to clipboard

Fails to compile with RN 0.69

Open oblador opened this issue 2 years ago • 6 comments

When using latest RC 6 the project fails to compile with:

FAILURE: Build failed with an exception.

* Where:
Build file '[...]/node_modules/react-native-mmkv/android/build.gradle' line: 163

* What went wrong:
A problem occurred evaluating project ':react-native-mmkv'.
> Expected directory '[...]/node_modules/react-native/android' to contain exactly one file, however, it contains more than one file.

I think this is due to hermes now being bundled as source code. It's possible that using the newish com.facebook.react gradle plugin instead would solve these problems and greatly simplify your build.gradle.

oblador avatar Jun 09 '22 08:06 oblador

Ah yes, that'd be awesome! Do you have any references for that new plugin?

mrousavy avatar Jun 13 '22 08:06 mrousavy

...does it even work with CMake? They're using Makefiles...

mrousavy avatar Jun 13 '22 08:06 mrousavy

Is there a solution? I also encountered this problem.

chentogit avatar Jun 23 '22 04:06 chentogit

This one: https://github.com/facebook/react-native/tree/HEAD/packages/react-native-gradle-plugin

As documented here: https://reactnative.dev/docs/new-architecture-library-android

oblador avatar Jun 23 '22 11:06 oblador

same problem

ajiehatajie avatar Jun 23 '22 12:06 ajiehatajie

android/build.gradle file's def rnAAR = fileTree("${defaultDir.toString()}").matching({ it.include "**/**/*.aar" }).singleFile above code makes this problem, pattern should be change from RN0.69

indicated below is sample from react-native-reanimated "**/react-native/**/*${buildType}.aar" (fyi. https://github.com/software-mansion/react-native-reanimated/blob/main/android/build.gradle#L532)

I made PR #414

YangJonghun avatar Jun 26 '22 12:06 YangJonghun

+1

brandon-austin-lark avatar Feb 03 '23 19:02 brandon-austin-lark

Is this even still a problem with the latest MMKV? I thought the new buildscript fixes that?

mrousavy avatar Feb 07 '23 11:02 mrousavy

This can help https://www.youtube.com/watch?v=iL-o8IJhwSQ&list=PLQhQEGkwKZUrempLnmxjt7ZCZJu1W3p2i&index=16

BraveEvidence avatar Feb 25 '23 14:02 BraveEvidence

Hey! Sorry I cannot reproduce the issue here and it has been inactive for a while. I am going over issues right now and want to keep the repo clean - so I'm closing this for now, if anyone can post a reproduceable example here I can re-open and take a look :)

mrousavy avatar Jul 17 '23 11:07 mrousavy