expo / config-plugins

Out-of-tree Expo config plugins for packages that haven't adopted the config plugin system yet.
427 stars 91 forks source link

Broken Android builds with the react-native-branch plugin [SDK 48] #168

Closed Noitham closed 1 year ago

Noitham commented 1 year ago

Summary

I've noticed when adding the @config-plugins/react-native-branch plugin on my project, Android stops building. The error thrown is the following:

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '.../android/app/build.gradle' line: 21

* What went wrong:
A problem occurred evaluating project ':app'.
> path may not be null or empty string. path=''

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':app'.
> compileSdkVersion is not specified. Please add it to build.gradle

* 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.
==============================================================================

As soon as removing the @config-plugins/react-native-branch from the project & app.cofing.ts plugins list, it builds fine again and no errors are shown.

Config Plugin

@config-plugins/react-native-branch

What platform(s) does this occur on?

Android

SDK Version

48

Reproducible demo

Project using:

{
...
"expo": "~48.0.9",
"expo-build-properties": "~0.6.0",
"react-native-branch": "5.8.0"
...
}
  1. Add @config-plugins/react-native-branch@5.0.0.
  2. Setup plugin on app.config.ts
    1. 
      ['@config-plugins/react-native-branch',
      {
        apiKey: process.env.BRANCH_API_KEY,
        iosAppDomain: process.env.BRANCH_URL,
      }]
  3. expo prebuild
  4. expo run:android 💥
Noitham commented 1 year ago

Seems it all was caused by android.enableProguardInReleaseBuilds being set to false.

wolfdavo commented 11 months ago

Where did you set this? Having the same issue and struggling to resolve.