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

Android compile issue on latest

Open venux92 opened this issue 8 months ago • 3 comments

Hi,

I'm getting an error when trying to compile on Android (iOS is fine)

android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:39: error: package undefined does not exist
import undefined.AesPackage;

android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:119: error: cannot find symbol
      new AesPackage(),
          ^
  symbol:   class AesPackage
  location: class PackageList

The following is generated in PackageList.java

Image

To fix the issue I need to add package="com.tectiv3.aes" to to node_modules/react-native-aes-crypto/android/src/main/AndroidManifest.xml which is definitely not ideal.

from

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

to

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tectiv3.aes">
</manifest>

This seemed to be linked to this https://github.com/react-native-community/discussions-and-proposals/issues/671

which was introduced on this commit https://github.com/tectiv3/react-native-aes/commit/6b3ecd8259849148c1401d656b28c90feefe31b5

Can we keep backward compatibility 🙏🏽

I'm using "react-native": "0.68.5"

Thanks

venux92 avatar Mar 25 '25 06:03 venux92

I guess you just have to stay on a previous package version since it is linked to how latest react-native works - no new features were added anyway. I totally understand your annoyance though.

tectiv3 avatar Apr 01 '25 13:04 tectiv3

Could we implement something similar to what this library did? where it checks for the graddle version and loads the appropriate AndroidManifest.xml so we can still use an updated version of this package.

https://github.com/callstack/react-native-builder-bob/pull/420/files

🙏🏽

venux92 avatar Apr 05 '25 11:04 venux92

I am open to PRs!

tectiv3 avatar Apr 11 '25 09:04 tectiv3