mkharibalaji / react-native-adyen-payment

React Native Adyen Payment
https://mkharibalaji.github.io/react-native-adyen-payment/
MIT License
35 stars 35 forks source link

Linking failed even though I add manually to MainApplication.java #75

Closed KerryDss closed 2 years ago

KerryDss commented 2 years ago

Hi

I am getting linking error message.I think

Here is the bug log output.

Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     /Users/kerrydss/Desktop/Work/bhg-ecommerce-rn/android/app/src/main/res/values/styles.xml:9:5-14:15: AAPT: error: resource color/colorPrimary (aka com.bhg:color/colorPrimary) not found.

     /Users/kerrydss/Desktop/Work/bhg-ecommerce-rn/android/app/src/main/res/values/styles.xml:9:5-14:15: AAPT: error: resource color/colorPrimaryDark (aka com.bhg:color/colorPrimaryDark) not found.

     /Users/kerrydss/Desktop/Work/bhg-ecommerce-rn/android/app/src/main/res/values/styles.xml:9:5-14:15: AAPT: error: resource color/colorAccent (aka com.bhg:color/colorAccent) not found.

     /Users/kerrydss/Desktop/Work/bhg-ecommerce-rn/android/app/src/main/res/values/styles.xml:20:7-24:15: AAPT: error: resource color/colorPrimary (aka com.bhg:color/colorPrimary) not found.

     /Users/kerrydss/Desktop/Work/bhg-ecommerce-rn/android/app/src/main/res/values/styles.xml:20:7-24:15: AAPT: error: resource color/colorPrimaryDark (aka com.bhg:color/colorPrimaryDark) not found.

     /Users/kerrydss/Desktop/Work/bhg-ecommerce-rn/android/app/src/main/res/values/styles.xml:20:7-24:15: AAPT: error: resource color/colorAccent (aka com.bhg:color/colorAccent) not found.

Here is my colors.xml

<resources>

    <!-- Base application theme. -->
    <!-- <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> -->
        <!-- Customize your theme here. -->
        <!-- <item name="android:textColor">#000000</item> -->
    <!-- </style> -->

    <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
          <item name="android:textColor">#000000</item>
          <item name="colorPrimary">@color/colorPrimary</item>
          <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
          <item name="colorAccent">@color/colorAccent</item>
      </style>
      <style name="AdyenCheckout.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
          <item name="boxStrokeColor">@color/primaryColor</item>
          <item name="hintTextColor">@color/primaryColor</item>
          <item name="android:minHeight">@dimen/input_layout_height</item>
      </style>
      <style name="ThreeDS2Theme" parent="Theme.MaterialComponents.Light.DarkActionBar">
          <item name="colorPrimary">@color/colorPrimary</item>
          <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
          <item name="colorAccent">@color/colorAccent</item>
      </style>

</resources>

This is my main application.java

package com.bhg;

import com.reactlibrary.AdyenPaymentPackage;
...
public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost =
      new ReactNativeHost(this) {
        @Override
        public boolean getUseDeveloperSupport() {
          return BuildConfig.DEBUG;
        }

        @Override
        protected List<ReactPackage> getPackages() {
          @SuppressWa rnings("UnnecessaryLocalVariable")
          List<ReactPackage> packages = new PackageList(this).getPackages();
          packages.add(new AdyenPaymentPackage())
          return packages;
        }

        @Override
        protected String getJSMainModuleName() {
          return "index";
        }
      };
KerryDss commented 2 years ago

I fixed it by updating sdk version