pchalupa / expo-alternate-app-icons

Provides functions that let you change the app icon.
https://www.npmjs.com/package/expo-alternate-app-icons
MIT License
43 stars 4 forks source link

Android gradle build failed #112

Open Marcel-Urlaubsguru opened 2 weeks ago

Marcel-Urlaubsguru commented 2 weeks ago

Hey, thanks for your work. I am currently trying to build an app with your package on expo eas. Unfortunately the android build fails.

Environment:

expo-env-info 1.2.0 environment info: System: OS: macOS 15.1 Shell: 5.9 - /bin/zsh Binaries: Node: 18.20.3 - ~/.nvm/versions/node/v18.20.3/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 9.6.7 - ~/.nvm/versions/node/v18.20.3/bin/npm Managers: CocoaPods: 1.15.2 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1 IDEs: Android Studio: 2023.1 AI-231.9392.1.2311.11255304 Xcode: 16.1/16B40 - /usr/bin/xcodebuild npmPackages: expo: ~50.0.20 => 50.0.21 expo-router: ~3.4.10 => 3.4.10 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.73.6 => 0.73.6 react-native-web: ^0.19.6 => 0.19.6 npmGlobalPackages: eas-cli: 12.6.2 Expo Workflow: managed

Error message:

FAILURE: Build completed with 2 failures. 1: Task failed with an exception.

A problem occurred evaluating project ':expo-alternate-app-icons'.

Could not find method useDefaultAndroidSdkVersions() for arguments [] on project ':expo-alternate-app-icons' of type org.gradle.api.Project.

  • Try: 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/.

    2: Task failed with an exception.

  • Where: Script '/home/expo/workingdir/build/node_modules/expo-modules-core/android/ExpoModulesCorePlugin.gradle' line: 65
  • What went wrong: A problem occurred configuring project ':expo'. Could not get unknown property 'release' for SoftwareComponent container of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
  • Try: 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/.

    BUILD FAILED in 1m 40s 10 actionable tasks: 10 executed Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

pchalupa commented 2 weeks ago

Thanks for the reporting this issue @Marcel-Urlaubsguru. I will have a look tomorrow. 👍 It might be related to the latest changes in the build.gradle.

pchalupa commented 1 week ago

By introducing this PR https://github.com/pchalupa/expo-alternate-app-icons/pull/106 I removed support for Expo SDK 50. It is because this function is introduced in expo-modules-code@1.12.26 but Expo SDK 50 depends on 1.11.8. The solution for you should be upgrading to the Expo SDK 51. If the upgrade is problematic for you, you can try this canary version https://www.npmjs.com/package/expo-alternate-app-icons/v/1.0.3--canary.9072319.0 and see If it helps. In the PR https://github.com/pchalupa/expo-alternate-app-icons/pull/113 tried to bump the expo-modules-core dependency.

Marcel-Urlaubsguru commented 1 week ago

Hey thanks for the answer, unfortunately the canary version has the some problem. Looks like I finally have to upgrade to Expo 51.

pchalupa commented 1 week ago

Hey thanks for the answer, unfortunately the canary version has the some problem. Looks like I finally have to upgrade to Expo 51.

If it is possible for you, then it is great. 👍 If not, this PR https://github.com/pchalupa/expo-alternate-app-icons/pull/106 can be reverted and I can release a backward compatible version of this lib. So you can migrate later. Just let me know. 👍

I will add a note about the Expo min version support to the readme.

Marcel-Urlaubsguru commented 2 days ago

It would be fantastic if you release a version compatible with older expo versions.