react-native-screens: Android - Build Failing

After upgrading to version 2.0.0-beta.10, running react-native run-android is failing.

> Task :react-native-screens:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-screens:compileDebugJavaWithJavac'.
> java.lang.reflect.UndeclaredThrowableException

downgrading to version 2.0.0-beta.4, the error goes away and build is completed successfully.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 13
  • Comments: 18 (1 by maintainers)

Most upvoted comments

same issue with version 2.3.0 and 2.2.0.

Downgrade to 2.0.0-beta.4 works

Thanks man this worked out for me !!

Disregard - see my next comment below

This might need to be re-opened? I’m hitting the issue with React Native 0.62.2 and react-native-screens 2.4.0. Reverting to 2.0.0-alpha.32 resolves the issue.

com.android.tools.build:gradle:3.6.2
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

2.4.0. Reverting back to 2.0.0-alpha.32 resolves the problem.

* What went wrong:
Execution failed for task ':SomeApp:processDevDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFa
cade
   > Android resource linking failed
     AAPT: error: resource style/Widget.AppCompat.TextView (aka com.someapp:style/Widget
.AppCompat.TextView) not found.
     error: resource style/Widget.AppCompat.TextView (aka com.someapp:style/Widget.AppCo
mpat.TextView) not found.
     error: resource style/Widget.AppCompat.TextView (aka com.someapp:style/Widget.AppCo
mpat.TextView) not found.
     error: resource style/Widget.AppCompat.TextView (aka com.someapp:style/Widget.AppCompat.TextView) not found.
     error: resource style/Widget.AppCompat.TextView (aka com.someapp:style/Widget.AppCompat.TextView) not found.
     error: failed linking references.

same issue with version 2.3.0 and 2.2.0.

Downgrade to 2.0.0-beta.4 works

Ok I’ve fixed the issue by changing

android/ gradle/ wrapper/ gradle-wrapper.properties distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip

android/ build.gradle

dependencies {
        classpath("com.android.tools.build:gradle:3.5.2")

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

These changes were found in the react-native v0.62.0-rc.5, which is not a stable release. I am using react-native v0.60.5 and made the above changes, no problems were faced. Let me know if this works for you guys.

@Maskedman99 Please reopen this issue, until a solution is found or root cause identified, let it be open so that the issue is easily visible to contributors and users.

I get the following error using 2.0.0-beta.10 in some machines, (in some machines it builds properly)

 [exec] :react-native-screens:compileReleaseJavaWithJavac (Thread[Execution worker for ':' Thread 13,5,main]) completed. Took 0.278 secs.
     [exec] 
     [exec] FAILURE: Build failed with an exception.
     [exec] 
     [exec] * What went wrong:
     [exec] Execution failed for task ':react-native-screens:compileReleaseJavaWithJavac'.
     [exec] > java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0

Same here, downgrading worked