Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find Symbol R (Android) on React Native 0.73 #229

Open
fobos531 opened this issue Jan 9, 2024 · 14 comments
Open

Cannot find Symbol R (Android) on React Native 0.73 #229

fobos531 opened this issue Jan 9, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@fobos531
Copy link

fobos531 commented Jan 9, 2024

Describe the issue

It seems like on newest React Native version (0.73.x) there's an issue when compiling the application. This did not occur on React Native 0.72.x.

[RUN_GRADLEW] > Task :react-native-square-in-app-payments:mergeReleaseShaders
[RUN_GRADLEW] > Task :react-native-square-in-app-payments:compileReleaseShaders NO-SOURCE
[RUN_GRADLEW] > Task :react-native-square-in-app-payments:generateReleaseAssets UP-TO-DATE
[RUN_GRADLEW] > Task :react-native-square-in-app-payments:generateReleaseRFile
[RUN_GRADLEW] > Task :react-native-square-in-app-payments:packageReleaseAssets
[RUN_GRADLEW] > Task :react-native-square-in-app-payments:extractReleaseAnnotations
[RUN_GRADLEW] > Task :react-native-square-in-app-payments:compileReleaseJavaWithJavac FAILED
[RUN_GRADLEW] /private/var/folders/9r/dyk4mj9s0_qgmnq197tdmrpr0000gn/T/eas-build-local-nodejs/3fd59a4f-8a3e-4f75-98ac-ab46fa1ec40e/build/client/apps/customer/node_modules/react-native-square-in-app-payments/android/src/main/java/sqip/react/CardEntryModule.java:304: error: cannot find symbol
[RUN_GRADLEW]     theme.applyStyle(R.style.sqip_Theme_CardEntry, true);
[RUN_GRADLEW]                       ^
[RUN_GRADLEW]   symbol:   variable style
[RUN_GRADLEW]   location: class R
[RUN_GRADLEW] Note: /private/var/folders/9r/dyk4mj9s0_qgmnq197tdmrpr0000gn/T/eas-build-local-nodejs/3fd59a4f-8a3e-4f75-98ac-ab46fa1ec40e/build/client/apps/customer/node_modules/react-native-square-in-app-payments/android/src/main/java/sqip/react/GooglePayModule.java uses or overrides a deprecated API.
[RUN_GRADLEW] Note: Recompile with -Xlint:deprecation for details.
[RUN_GRADLEW] 1 error
[RUN_GRADLEW] > Task :react-native-safe-area-context:compileReleaseKotlin
[RUN_GRADLEW] w: file:///private/var/folders/9r/dyk4mj9s0_qgmnq197tdmrpr0000gn/T/eas-build-local-nodejs/3fd59a4f-8a3e-4f75-98ac-ab46fa1ec40e/build/client/apps/customer/no

To Reproduce

Initialize an empty react-native 0.73 project.
Add and configure the square in app payments SDK.
Compile android app.

Expected behavior

The app should compile successfully.

Environment (please complete the following information):

  • Android
  • macOS
  • In-App payments plugin version: 1.7.5
@fobos531 fobos531 added the bug Something isn't working label Jan 9, 2024
@FurySwordXD
Copy link

FurySwordXD commented Jan 14, 2024

Same issue was working fine in React Native 0.72.x, errors out in 0.73.

As a temporary work around, I've simply commented out the line
// theme.applyStyle(R.style.sqip_Theme_CardEntry, true);
and made it patch.

@amanrajtoppoart007
Copy link

Any news when this will be fixed , getting the same issue with react native 0.73

@fobos531
Copy link
Author

Any news when this will be fixed , getting the same issue with react native 0.73

@amanrajtoppoart007 In the meantime, you can use the above suggested patch, however, for a more permanent solution, I think something like this can be used: stripe/stripe-react-native#1579

@Armaxis
Copy link
Member

Armaxis commented Feb 20, 2024

Do you have a Theme defined in your app like this?

    <style name="sqip.Theme.CardEntry" parent="AppTheme">
        <item name="buttonStyle">@style/CardEntryButton</item>
        <item name="android:windowBackground">@color/colorCardEntryBackground</item>
        <item name="android:textColorHint">@color/alto</item>
    </style>

If you don't want any customization, try an empty definition:

<style name="sqip.Theme.CardEntry" parent="Theme.AppCompat" />

@Armaxis Armaxis closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2024
@Armaxis Armaxis reopened this Feb 20, 2024
@theahmadzai
Copy link

Do you have a Theme defined in your app like this?

    <style name="sqip.Theme.CardEntry" parent="AppTheme">
        <item name="buttonStyle">@style/CardEntryButton</item>
        <item name="android:windowBackground">@color/colorCardEntryBackground</item>
        <item name="android:textColorHint">@color/alto</item>
    </style>

If you don't want any customization, try an empty definition:

<style name="sqip.Theme.CardEntry" parent="Theme.AppCompat" />

Did not work for me:
image

@JonathanNakhla-Square
Copy link

@theahmadzai can you try adding sqip.react. to the line theme.applyStyle(R.style.sqip_Theme_CardEntry, true); as such:

theme.applyStyle(sqip.react.R.style.sqip_Theme_CardEntry, true);

Trying to temporarily unblock you until we spin up a new update! (And thx @fobos531 for the suggestion!)

@tannguyen05
Copy link

tannguyen05 commented Mar 26, 2024

@JonathanNakhla-Square i tried adding sqip.react. but still error
image

@trattles
Copy link

Also tried the sqip.react fix to no avail.

For what it's worth -- I just commented that theme.applyStyle line out completely -- my android app builds and the card entry modal appears to still be working normally in my testing.

@theahmadzai
Copy link

I think it's a big issue, a main blocker specially for us after upgrade we're unable to take payments but no response from square or timeline

@trattles
Copy link

@theahmadzai have you tried commenting out that line?

It's in android/src/main/java/sqip/react/CardEntryModule.java

comment out theme.applyStyle(R.style.sqip_Theme_CardEntry, true); around line 304.

That worked fine for me, and the payments modal seems to be working fine.

IIUC it's just trying to grab a few animation style props for closing the modal, and the default android theme falls back just fine.

@tannguyen05
Copy link

I want to customize the payment entry form, so the theme.applyStyle line is needed

Waiting for an update!

@YoussefHenna
Copy link

I'm seeing this warning

Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported

I'm guessing this is what is causing the underlying issue and the namespace needs to be migrated to the build.gradle (See https://stackoverflow.com/a/74086678/8805150)

@doron2402
Copy link

any update on this issue?

@jackdewhurst
Copy link

This is still an issue now in November..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests