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

Failing Expo Android Builds #2910

Open
smlparry opened this issue Jan 10, 2025 · 4 comments
Open

Failing Expo Android Builds #2910

smlparry opened this issue Jan 10, 2025 · 4 comments

Comments

@smlparry
Copy link

smlparry commented Jan 10, 2025

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

This error (outlined here: expo/expo#30725) is being caused by this package when building using Expo.

> Task :app:processDebugMainManifest FAILED
[androidx.versionedparcelable:versionedparcelable:1.1.1] /Users/bahadir/.gradle/caches/transforms-4/2ce0032ccb31eebf8bef327c4969c555/transformed/versionedparcelable-1.1.1/AndroidManifest.xml Warning:
        Namespace 'androidx.versionedparcelable' is used in multiple modules and/or libraries: androidx.versionedparcelable:versionedparcelable:1.1.1, com.android.support:versionedparcelable:28.0.0. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace
/Users/bahadir/Desktop/last-main/learnity-mobil/android/app/src/debug/AndroidManifest.xml:28:18-86 Error:
        Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.12.0] AndroidManifest.xml:28:18-86
        is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
        Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:6:5-162 to override.

See https://developer.android.com/r/studio-ui/build/manifest-merger for more information about the manifest merger.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed with multiple errors, see logs

We recently switched to react-native-iap to make our builds more stable and avoid having to use the postinstall.js script hack

Is there a way to update this package so that it sets android.enableJetifier to true (and not false as the new default is)

https://github.com/bahadiraraz as outlined the fix here: expo/expo#30725 (comment)

Expected Behavior

This conflict doesn't exist

Screenshots

Environment:

  • react-native-iap: 12.15.7
  • react-native: 0.76.3
  • Platforms (iOS, Android, emulator, simulator, device): Expo Android

To Reproduce
Steps to reproduce the behavior:

  1. Create new expo app
  2. Install this package
  3. Create an android build

[Optional] Additional Context

More details here: expo/expo#30725

@Tieu-Mai-Nhi
Copy link

Tieu-Mai-Nhi commented Jan 14, 2025

I also add a file withGradleProperties.js like and set "android.enableJetifier" to true but after build show an error like:
`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
> 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'. However we cannot choose between the
following variants of project :react-native-iap:
- amazonDebugApiElements
- playDebugApiElements
All of them match the consumer attributes:
- Variant 'amazonDebugApiElements' capability 'H?i Bαi:react-native-iap:unspecified' declares 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':
- Unmatched attributes:
- Provides attribute 'com.android.build.api.attributes.ProductFlavor:store' with
value 'amazon' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'amazonDebug' but the consumer didn't ask for it
- Provides attribute 'store' with value 'amazon' but the consumer didn't ask for
it
- Variant 'playDebugApiElements' capability 'H?i Bαi:react-native-iap:unspecified' declares 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':
- Unmatched attributes:
- Provides attribute 'com.android.build.api.attributes.ProductFlavor:store' with
value 'play' but the consumer didn't ask for it
- Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'playDebug' but the consumer didn't ask for it
- Provides attribute 'store' with value 'play' but the consumer didn't ask for it

  • Try:

Ambiguity errors are explained in more detail at https://docs.gradle.org/8.10.2/userguide/variant_model.html#sub:variant-ambiguity.
Review the variant matching algorithm at https://docs.gradle.org/8.10.2/userguide/variant_attributes.html#sec:abm_algorithm.
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.`

Environment:

"react-native-iap": "^12.15.4",
"react-native": "0.76.6",
"expo": "~52.0.25"

@neuroleptik
Copy link

Hello same problem here

@LukasB-DEV
Copy link

Same issue than #2812
Try this fix: #2812 (comment)

@neuroleptik
Copy link

@LukasB-DEV Indeed fixed by deleting the supportLibVersion = "28.0.0" manually and build with eas in local

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

No branches or pull requests

4 participants