react-native-unimodules
react-native-unimodules copied to clipboard
Could not find MainApplication.java
On line 77 of gradle.groovy, the findMainJavaApp def will throw an error if you have a more complex application structure.
Right now I'm using the following patch on the node modules file post installation, but this is interfering with my deployment process so I would like to see this fixed soon.
- def findMainJavaApp = new FileNameFinder().getFileNames(rootProject.getProjectDir().getPath(), '**/MainApplication.java', '')
+ def findMainJavaApp = new FileNameFinder().getFileNames(rootProject.getProjectDir().getPath(), '**/pierre/MainApplication.java', '')
Thanks.
Same problem.
When we run react-native run-android --variant=appDevDebug
to install app with specified variant, unimodule will throw an exception You need to have MainApplication in your project
In my case, we use productFlavor to extract multi apk.
node_modules/react-native-unimodules/gradle.groovy will count **/MainApplication.java
, and failed.
I think it is better to change:
def findMainJavaApp = new FileNameFinder().getFileNames(rootProject.getProjectDir().getPath(), '**/MainApplication.java', '')
def findMainKtApp = new FileNameFinder().getFileNames(rootProject.getProjectDir().getPath(), '**/MainApplication.kt', '')
to:
def findMainJavaApp = new FileNameFinder().getFileNames(rootProject.getProjectDir().getPath(), '**/main/**/MainApplication.java', '')
def findMainKtApp = new FileNameFinder().getFileNames(rootProject.getProjectDir().getPath(), '**/main/**/MainApplication.kt', '')
Has anyone had eyes on this? Been open for a while without any attention or updates. Unimodules does not appear to support project structures that are using variants. I've got main
, debug
, and beta
with respective MainApplication.java
for each–none of them are successfully found when running the app.
Anything I can provide to help?