Eas android build

Expo SDK 46
I get such an error. Please could you help

🤖 Android build failed:
Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.
[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/newarchitecture/MainApplicationReactNativeHost.java:23: error: cannot find symbol
908[stderr] import com.iksirakademi.BuildConfig;
909[stderr]                         ^
910[stderr]   symbol:   class BuildConfig
911[stderr]   location: package com.iksirakademi
912[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/MainApplication.java:29: error: cannot find symbol
913[stderr]       return BuildConfig.DEBUG;
914[stderr]              ^
915[stderr]   symbol: variable BuildConfig
916[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/MainApplication.java:52: error: cannot find symbol
917[stderr]     if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
918[stderr]         ^
919[stderr]   symbol:   variable BuildConfig
920[stderr]   location: class MainApplication
921[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/MainApplication.java:52: error: illegal parenthesized expression
922[stderr]     if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
923[stderr]         ^
924[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/MainApplication.java:63: error: cannot find symbol
925[stderr]     ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
926[stderr]                                         ^
927[stderr]   symbol:   variable BuildConfig
928[stderr]   location: class MainApplication
929[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/MainApplication.java:85: error: cannot find symbol
930[stderr]     if (BuildConfig.DEBUG) {
931[stderr]         ^
932[stderr]   symbol:   variable BuildConfig
933[stderr]   location: class MainApplication
934[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/MainApplication.java:85: error: illegal parenthesized expression
935[stderr]     if (BuildConfig.DEBUG) {
936[stderr]         ^
937[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/MainActivity.java:18: error: package R does not exist
938[stderr]     setTheme(R.style.AppTheme);
939[stderr]              ^
940[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/MainActivity.java:38: error: cannot find symbol
941[stderr]     return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,
942[stderr]                                                   ^
943[stderr]   symbol:   variable BuildConfig
944[stderr]   location: class MainActivity
945[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/MainActivity.java:72: error: cannot find symbol
946[stderr]       reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
947[stderr]                                 ^
948[stderr]   symbol:   variable BuildConfig
949[stderr]   location: class MainActivityDelegate
950[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/MainActivity.java:80: error: cannot find symbol
951[stderr]       return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
952[stderr]              ^
953[stderr]   symbol:   variable BuildConfig
954[stderr]   location: class MainActivityDelegate
955[stderr] /home/expo/workingdir/build/android/app/src/main/java/com/iksirakademi/cinaralti/newarchitecture/MainApplicationReactNativeHost.java:43: error: cannot find symbol
956[stderr]     return BuildConfig.DEBUG;
957[stderr]            ^
958[stderr]   symbol:   variable BuildConfig
959[stderr]   location: class MainApplicationReactNativeHost
960[stderr] 12 errors
961[stderr] FAILURE: Build failed with an exception.
962[stderr] * What went wrong:
963[stderr] Execution failed for task ':app:compileReleaseJavaWithJavac'.
964[stderr] > Compilation failed; see the compiler error output for details.
965[stderr] * Try:
966[stderr] > Run with --stacktrace option to get the stack trace.
967[stderr] > Run with --info or --debug option to get more log output.
968[stderr] > Run with --scan to get full insights.
969[stderr] * Get more help at https://help.gradle.org
970[stderr] BUILD FAILED in 11m 14s

are you actually using the “react-native-push-notification” in your project? it’s listed in your dependencies, but i suspect you are actually using “expo-notifications”. try removing “react-native-push-notification”

1 Like

yes, I am using expo notification. i am deleting the react-native notification immediately

it didn’t unfortunately. i haven’t been able to get eas android build for 2 days.

have you tried following this guide? Troubleshooting build errors and crashes - Expo Documentation

1 Like

i guess I didn’t find the solution there either

Try creating a new Expo app and installing all of the dependencies but without adding any of the JS code. Just leave the default App.js file as-is. Then try to build it.

Do you get the same error? If so, try to narrow down what dependency is causing the problem. You should be able to do something like a binary search/bisection search. i.e. add half of the dependencies. If it fails in the same way, the problem is probably in those dependencies. Remove half of them. Does the problem persist? Or does it go away? If it persists, then you have now narrowed the problem to just those dependencies. Otherwise it must be in the other dependencies that you’ve just removed.

Hopefully you will quickly find the dependency that’s causing the problem. Then you can either remove it, or upgrade it, or if you can’t figure out what’s wrong with it, post what you have found and we can see if we can figure it out.

Hi! I tried a build on a fresh Expo 46 project with the same dependencies, but didn’t see the error. That had me wondering if passing the --clear-cache flag to eas build would help. Was also wondering if using the deprecated expo-analytics-segment package could be causing problems. However, we see that you’ve had some successful Android builds since then. If there’s a particular change that did the trick, we’d love to hear about it. Thank you!

1 Like

Thank God Almighty, who gave me food from dry wood, I was able to do it. Thank you for helping me.

this is because I typed the package Id incorrectly. I did it with the backup file I received before starting the build process and it improved.

1 Like

Hi I also have the same problem could you please explain it with more details

Hi @jupiteryu

Try running expo-cli doctor and see if it complains about anything

Sorry it’s going to be a little late, but my problem is that I misspelled the package name in app.json.

1 Like

Expo sucks…icant build anything just GRADLE BULD FAILED WITH UNKNOWN ERROR???AND THERE IS NO SOLUTION IN THE WHOLE DAMN INTERNET

1 Like

You’ll need to provide more info.

What does npx expo-env-info give you?

What does npx expo-doctor give you?

Do you have an android directory in your project?
What dependencies and devDependencies do you have in package.json?
What plugins do you have in app.json?

Don’t post any sensitive info, though.