Skip to content

Fix ProGuard/R8 crash with React Native 0.87 and AGP 9 - #976

Open
AlexCernik wants to merge 1 commit into
henninghall:masterfrom
AlexCernik:patch-2
Open

Fix ProGuard/R8 crash with React Native 0.87 and AGP 9#976
AlexCernik wants to merge 1 commit into
henninghall:masterfrom
AlexCernik:patch-2

Conversation

@AlexCernik

Copy link
Copy Markdown

When using React Native 0.87 with AGP 9 and R8/ProGuard enabled, the app can crash on startup with the following error:

Wrong configuration of external resource loader:
java.lang.AssertionError:
Class net.time4j.android.spi.AndroidResourceLoader has no zero argument constructor

This was not reproducible with React Native 0.86.2 and NDK 27.

This PR updates the ProGuard documentation with the rules required to prevent R8 from removing the zero-argument constructor used by Time4J:

-keep public class net.time4j.android.ApplicationStarter
-keep public class net.time4j.PrettyTime
-keep public class net.time4j.android.spi.AndroidResourceLoader {
    public <init>();
}

When using React Native 0.87 with AGP 9 and R8/ProGuard enabled, the app can crash on startup with the following error:

Wrong configuration of external resource loader:
java.lang.AssertionError:
Class net.time4j.android.spi.AndroidResourceLoader
has no zero argument constructor

This was not reproducible with React Native 0.86.2 and NDK 27.

This PR updates the ProGuard documentation with the rules required to prevent R8 from removing the zero-argument constructor used by Time4J:

`
-keep public class net.time4j.android.ApplicationStarter
-keep public class net.time4j.PrettyTime
-keep public class net.time4j.android.spi.AndroidResourceLoader {
    public <init>();
}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant