Task :expo:compileReleaseJavaWithJavac FAILED

  1. SDK Version: 41
  2. Platforms(Android/iOS/web/all): Android

I’m trying to build for Android for the first time, but it keeps failing with this error:

> Task :expo:compileReleaseJavaWithJavac FAILED
[stderr] /home/expo/workingdir/build/node_modules/expo/android/build/generated/expo/src/main/java/expo/modules/ExpoModulesPackageList.java:9: error: method asList in class Arrays cannot be applied to given types;
[stderr]     static final List<Package> packagesList = Arrays.<Package>asList(
[stderr]                                                     ^
[stderr]   required: T[]
[stderr]   found: ReactAdapterPackage,AmplitudePackage,ApplicationPackage,ConstantsPackage,BasePackage,CryptoPackage,DevLauncherPackage,ErrorRecoveryPackage,FileSystemPackage,FontLoaderPackage,GLPackage,ImageLoaderPackage,ImageManipulatorPackage,ImagePickerPackage,KeepAwakePackage,MediaLibraryPackage,SplashScreenPackage,UpdatesPackage
[stderr]   reason: varargs mismatch; DevLauncherPackage cannot be converted to Package
[stderr]   where T is a type-variable:
[stderr]     T extends Object declared in method <T>asList(T...)

In my build.gradle I have

ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
    }
   ...
dependencies {
    classpath("com.android.tools.build:gradle:4.1.0")
    ...

and in gradle-wrapper.properties I have

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

I saw online I should change the versions to 7.0.0 and 7.0.3, but the issue still persists.

I agree that EAS needs to get with the times, we need to bump this up to Gradle 7.2 support. This has been out for a long time. 6.9 is old.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.