Aamir J
Aamir J

Reputation: 33

Expo - Package 'com.xxx.native.xxx' from AndroidManifest.xml is not a valid Java package name as 'native' is a Java keyword

I have used the pattern 'com.mycompanyname.native.appname' to name the bundle Ids for my apps since years and have created many apps using the keyword "native" in the package name. I didn't get this error when using classic expo builds until I switched to EAS builds. Now, I have to upgrade a few of the live apps, can there be a workaround to overcome this error?

Upvotes: 0

Views: 663

Answers (1)

kbrandwijk
kbrandwijk

Reputation: 51

Yes, there is a workaround, which is a two step progress:

  • Adjust the package name in your config to be a valid Java name
  • Use a config plugin to set the applicationId in your build.gradle to your old package name

That way, your applicationId for Play Console stays the same, and the package name used in Java is valid for building.

Here is a gist with an example config plugin, and how to add it to your app.json:

https://gist.github.com/kbrandwijk/cef9e3b01cff91f8dfad8f47f02cb880

Upvotes: 1

Related Questions