react-native-masked-view / masked-view

React Native Masked View Library
MIT License
960 stars 120 forks source link

Android build error: package undefined does not exist #212

Open scarlac opened 10 months ago

scarlac commented 10 months ago

Version: 0.3.0 will fail to build with react-native@0.68.6 with the following error:

PackageList.java:39: error: package undefined does not exist
import undefined.RNCMaskedViewPackage;

Explanation: The PackageList.java file for Android is generated at build-time, which includes all RN packages with native code, also contains a line for masked-view, however the line that gets generated seems to lack the package path: <my/project/path>/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java

// ...
// @react-native-masked-view/masked-view
import undefined.RNCMaskedViewPackage;
// ...
public ArrayList<ReactPackage> getPackages() {
// ...

It seems the reported package path is 'undefined'. Perhaps it's related to the 0.3.0 build changes to support newer RN versions?

Workaround: Reverting to 0.2.9 fixes the issue.

taimoorsultani commented 10 months ago

I am facing the same issue.

I'm using the following versions.

"react": "17.0.2",
"react-native": "^0.66.5",
"@react-native-masked-view/masked-view": "^0.3.0",
abdi4 commented 8 months ago

I was getting this on version 0.3.1 of @react-native-masked-view/masked-view on react-native v0.67.5. Downgrading to v0.2.9 works as a temporary solution.

khryshan commented 7 months ago

Downgrading to v0.2.9 worked for me.

Isaccobosio commented 6 months ago

Any update?

christophby commented 2 months ago

Similar error here. I got

groovy.json.JsonException Unable to determine the current character, it is not a string, number, array, or object

and downgrading to 0.2.9 fixed it for me.