Skip to main content
Question

RevenueCat Paywall Component Causing Crash on Android - NoSuchMethodError in AnimatedContent Method


Forum|alt.badge.img

I'm encountering a crash on Android when trying to display the RevenueCat paywall component in my React Native app. The same component works fine on iOS, but on Android, the app crashes with the following error:

java.lang.NoSuchMethodError: No static method AnimatedContent(Ljava/lang/Object;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Alignment;Ljava/lang/String;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V in class Landroidx/compose/animation/AnimatedContentKt; or its super classes

 

Steps to Reproduce:

  1. Implement the RevenueCat paywall component in the app. 

import React, { useEffect, useState } from 'react';

import { View, ActivityIndicator, Text } from 'react-native';

import Purchases from 'react-native-purchases';

import RevenueCatUI from 'react-native-purchases-ui';

const PayWallScreen = ({ navigation, route, setLoading }) => {

  const [offerings, setOfferings] = useState(null);

  const [loading, setLoadingState] = useState(true);

  useEffect(() => {

    navigation.setOptions({ headerShown: true });

    const fetchOfferings = async () => {

      try {

        const fetchedOfferings = await Purchases.getOfferings();

        if (fetchedOfferings.current !== null) {

          setOfferings(fetchedOfferings.current);

        } else {

          console.log("No offerings found");

        }

      } catch (e) {

        console.error("Error fetching offerings:", e);

      } finally {

        setLoadingState(false);

        setLoading(false);

      }

    };

    fetchOfferings();

  }, []);

  if (loading) {

    return <ActivityIndicator size="large" color="#0000ff" />;

  }

  return (

    <View style={{ flex: 1 }}>

      {offerings ? (

        <RevenueCatUI.Paywall />

      ) : (

        <View>

          <Text>No offerings available</Text>

        </View>

      )}

    </View>

  );

};

export default PayWallScreen;
 

  1. Run the app on an Android device.
  2. Navigate to the screen where the paywall is supposed to be displayed.
  3. The app crashes as soon as the paywall <RevenueCatUI.Paywall /> is rendered.

What I Have Tried:

  • Added the necessary ProGuard rules for Jetpack Compose and RevenueCat as recommended in the documentation.
  • Verified that the RevenueCat SDK is correctly configured and later offering shows on console log.
  • Cleaned and rebuilt the project multiple times.

 

Additional Notes:

I've searched the community and StackOverflow for similar issues, but the solutions provided (e.g., adding ProGuard rules, avoiding modals) have not resolved the issue.

I would appreciate any insights or suggestions on how to fix this crash.

 

SDK and Versions:

  • React Native: 0.74.0
  • "react-native-purchases": "^8.0.1",

    "react-native-purchases-ui": "^8.0.0",

  • Android Studio: Dolphin | 2021.3.1 Patch 2
  • Android Device: Pixel 4a, running Android 12

 

This post has been closed for comments

6 replies

Forum|alt.badge.img+6
  • Active Member
  • 11 replies
  • August 15, 2024

Same on flutter using purchases_flutter: ^7.0.2


Forum|alt.badge.img+3

I got eactly the same problem for android. Note that ios works fine.

Note that I am using "react-native-purchases-ui": "^8.0.0"


Forum|alt.badge.img+6
  • Active Member
  • 11 replies
  • August 18, 2024

any updates on this? 


Forum|alt.badge.img+3
  • New Member
  • 2 replies
  • August 20, 2024

Hey. We are getting the same exact error with purchases_flutter: ^7.0.2

We are waiting for a fix to publish our android app. So, any luck ?


Forum|alt.badge.img+3
  • RevenueCat Staff
  • 55 replies
  • August 22, 2024

Hi everyone, thanks for reporting this issue! We were able to reproduce this issue in flutter and react native. It happens with the new multi-tier template. We just released version 8.1.0 for both platforms that should fix this issue.

Please check it out and let us know if you run into any more issues!


Forum|alt.badge.img+3
  • New Member
  • 2 replies
  • August 22, 2024

Hey. Working like charm now. Thank you. For everyone, you have to use version 8.1.0 for both  purchases_flutter and purchases_ui_flutter


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings