Answered

React Native Android builds fail


  • Connector
  • 7 replies

Hey, I'm getting the following build error trying to integrate the React Native SDK with Android builds. iOS builds fine.

 

> Task :app:processDebugResources FAILED
 
FAILURE: Build failed with an exception.
 
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
ERROR:: AAPT: error: resource style/ThemeOverlay.MaterialComponents.Light.BottomSheetDialog (aka com.example.app/ThemeOverlay.MaterialComponents.Light.BottomSheetDialog) not found.
error: failed linking references.

React Native 0.65.1

icon

Best answer by Ross M11 5 November 2021, 22:35

View original

25 replies

I'm also experiencing a sudden build fail since today, but with a different error:

> Task :intercom_intercom-react-native:compileReleaseJavaWithJavac FAILED
/home/circleci/App/node_modules/@intercom/intercom-react-native/android/src/main/java/com/intercom/reactnative/IntercomModule.java:17: error: package com.google.firebase.messaging does not exist
import com.google.firebase.messaging.RemoteMessage;
^
/home/circleci/App/node_modules/@intercom/intercom-react-native/android/src/main/java/com/intercom/reactnative/IntercomModule.java:52: error: cannot find symbol
public static boolean isIntercomPush(RemoteMessage remoteMessage) {
^
symbol: class RemoteMessage
location: class IntercomModule
/home/circleci/App/node_modules/@intercom/intercom-react-native/android/src/main/java/com/intercom/reactnative/IntercomModule.java:63: error: cannot find symbol
public static void handleRemotePushMessage(@NonNull Application application, RemoteMessage
^
symbol: class RemoteMessage
location: class IntercomModule
Note: /home/circleci/App/node_modules/@intercom/intercom-react-native/android/src/main/java/com/intercom/reactnative/IntercomModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Ios builds fine, only android is having issues

 

I've actually also had that error several times — it seems to be inconsistent for me even if I explicitly add the firebase-messaging dependency, and sometimes retrying a few times gets rid of it...

Both issues are related to Intercom dependencies not being installed. This one firebase-messaging, and my issue above is appcompat or material.

Hey,

We get this also ... seems to be because you left the dependency out of 10.1 SDK.

We use @intercom/intercom-react-native": "^1.0.3" and this has (in its build.gradle) :

dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'io.intercom.android:intercom-sdk:10.+'
}

so the new 10.1 gets pulled in.

To workaround for TODAY, I can change it to 10.0.3 and get 10.0.3, or add

dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'io.intercom.android:intercom-sdk:10.+'
implementation 'com.google.firebase:firebase-messaging:20.2.+'
}

But both of these BREAK my CI/CD pipeline. Please sort it out and push a quick 1.0.4!!!

@eric f11​ You selected @jerry​'s answer, but this does not solve the underlying issue of the SDK having incorrect dependencies specified. Intercom has to update the package.

Userlevel 1

@ray​, I have our mobile engineers looking into this. For now, @jerry​'s is the best available answer for the current situation. Once I receive an update from our mobile engineers, I will update this 👍

Had a similar issue with the react-native integration for android. Intercom is importing some classes from firebase-messaging but is not adding that as a dependency. Adding it to our app does not seem to resolve the issue, so I had to add it to the module itself, in node_modules, which is a horrible hack. Hopefuly Intercom can fix it asap.

https://github.com/intercom/intercom-react-native/releases/tag/v1.0.4/p>

 

This release seems to fix the issue for me!

I updated the package to 1.0.5 but I'm getting the same error.

ERROR:: AAPT: error: resource style/ThemeOverlay.MaterialComponents.Light.BottomSheetDialog

 

Userlevel 1

Hi @user106​, what triggers this error? Do you have any additional crash logs or similar to share here?

It's the same error as the original post, building the android app causes it.

The styles from the appcompat/material components dependency are not ending up in the build due to the dependency being missing from the SDK or incompatible with some other part of RN.

Yes, it's the same error as the original post.

The firebase dependency gets fixed by 1.0.4, but I'm still getting this one on material components.

Userlevel 1

Hey @user106​, @ray​, which version of React Native are you running on your apps?

"react-native": "0.62.0"

Not much, the logs are the same as the original post.

Task :app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
ERROR:: AAPT: error: resource style/ThemeOverlay.MaterialComponents.Light.BottomSheetDialog (aka com.example.app/ThemeOverlay.MaterialComponents.Light.BottomSheetDialog) not found.
error: failed linking references.

"react-native": "0.62.0"

Not much, the logs are the same as the original post.

Task :app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
ERROR:: AAPT: error: resource style/ThemeOverlay.MaterialComponents.Light.BottomSheetDialog (aka com.example.app/ThemeOverlay.MaterialComponents.Light.BottomSheetDialog) not found.
error: failed linking references.

Userlevel 1

Can you try clearing the cache from xcframework, delete node_modules and delete package-lock.json?

xcframework doesn't affect Android. Regardless clearing node_modules and package-lock doesn't help, this happens on all our developers' systems and CI which does not cache.

We're approaching a month now stuck on the same error here. Our subscription isn't feeling like great value right now because the RN integration seems very undercooked, we haven't experienced errors like this on any of our other mobile integrations.

Userlevel 1

Apologies, @ray​, I can totally appreciate your frustration here. I'm going to message you directly in Intercom and connect you with our Support team to help this get resolved once and for all.

I wanted to chime in and report that I was experiencing this same exact issue with version 1.1.1 of the package.

 

I resolved it by adding the entry shown below to the styles.xml file at the following path.

android/app/src/main/res/values/styles.xml

Here is the entry (the empty style tag with the name property of "ThemeOverlay.MaterialComponents.Light.BottomSheetDialog")

<resources>
 
// .....
 
<style name="ThemeOverlay.MaterialComponents.Light.BottomSheetDialog">
</style>
 
</resources>

 

I just uninstalled the old deprecated library and installed this library. But for some reason Android doesn't build. Everytime I rebuild I am also facing the same errors as mentioned above. How is this still not fixed?

Intercom messaged me directly about it 2 months ago to "investigate the issue." I followed up a month ago and they still had no update.

 

So yeah, I have no idea what they're doing. It does seem crazy to advertise this integration and have it be broken for three months.

@eric f11​ this is still breaking android builds as of 1.1.1

 

Can you please escalate this ASAP to your dev team? There's no good workaround now because the old deprecated library and new supported library are both causing build breakages, and the only solution to get our android builds working again is to remove intercom support from our mobile app altogether.

I had this same issue with 1.1.1 - I fixed it by doing what I mention in my post that is above.

I had this same issue with 1.1.1 - I fixed it by doing what I mention in my post that is right above @philip v​ 

Reply