On my local environment, when I run “expo prebuild” or “npx expo prebuild”, the generated package directory is different from the package name specified in app.json.
For example, in app.json, expo.android.package is something like “com.ExampleApp”. When I run “expo prebuild”, the directory structure looks like this: android/app/src/main/java/com/exampleapp.
I have created a config plugin that adds a Java file inside android/app/src/main/java/com/exampleapp/ using withDangerousMod. It works on my local environment, but when I build the app using EAS, I found that the directory structure looks like this: android/app/src/main/java/com/ExampleApp. Due to this, I’m not able to create the file.
I can’t change the package name because the app belongs to the company that I’m employed by. Is there any way to make the package name and the directory structure consistent?
I’m on the managed workflow, eas-cli/3.9.2, Windows 11.
I’m not sure what is the reason for the different behavior. I see 2 potential options:
If you are on SDK 46 or newer you are using expo prebuild locally, by EAS Build is running npx expo prebuild. You should use npx expo prebuild instead if that is the case.
It might be caused by windows case insensitive file system, if that is the case, then write your plugin to work with android/app/src/main/java/com/ExampleApp and it should automatically work with android/app/src/main/java/com/exampleapp.
The behavior is seen on both expo prebuild and npx expo prebuild. And you were right about the windows case insensitive file system. I updated the plugin to use ExampleApp in the path and it works. Thanks!