react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

Issue Building for Android

Open ColtraneNadler opened this issue 1 year ago • 1 comments

Description

Error when attempting to build for android.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve project :react-native-iap.
     Required by:
         project :app
      > No matching variant of project :react-native-iap was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.6.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
          - No variants exist.
   > Could not resolve project :react-native-iap.
     Required by:
         project :app
      > No matching variant of project :react-native-iap was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.6.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
          - No variants exist.

There also no listed outgoing variants when using ./gradlew :react-native-iap:outgoingVariants --info


> Task :react-native-iap:outgoingVariants
Caching disabled for task ':react-native-iap:outgoingVariants' because:
  Build cache is disabled
Task ':react-native-iap:outgoingVariants' is not up-to-date because:
  Task has not declared any outputs despite executing actions.

Environment:

  • react-native-iap: 12.15.7
  • react-native: 0.73.6

My existing build.gradle file has the following defaultConfig

android {
...
  defaultConfig {
        ...
        missingDimensionStrategy 'store', 'play' // or amazon
        multiDexEnabled true
        ...
    }
  
}

To Reproduce Steps to reproduce the behavior:

./gradlew build

ColtraneNadler avatar Dec 01 '24 23:12 ColtraneNadler

For me, the plugin entry was missing in the config:

https://react-native-iap.hyo.dev/docs/get-started/#expo

After adding that, and running yarn expo prebuild again, the problem disappeared.

arechsteiner avatar Jan 03 '25 12:01 arechsteiner

I’m closing all issues reported in versions below 14, as the library now supports the new architecture with NitroModules and has been completely revamped.

hyochan avatar Sep 30 '25 18:09 hyochan