Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build failing after update to React Native 0.58.3 #365

Open
ekmobile opened this issue Jan 31, 2019 · 2 comments
Open

Android build failing after update to React Native 0.58.3 #365

ekmobile opened this issue Jan 31, 2019 · 2 comments

Comments

@ekmobile
Copy link

After updating to React Native 0.58.3 the Android build is failing. See enclosed log file. There seem to be resources missing for Android 9.

android-build-failing.log

@saplf
Copy link

saplf commented Feb 19, 2019

I also encountered this error. It seems that RN updated Android SDK to 28 in 0.58.* while this library still using 27.

FYI, there're some methods to fix it.

  • Modify compileSdkVersion and targetSdkVersion in file node_modules/react-native-picker/android/build.gradle to 28 manually. Just make sure its value before every build.

  • Refactor the code in node_modules/react-native-picker/android/build.gradle to get versions dynamically:

    def safeExtGet(prop, fallback) {
        rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
    }
    
    android {
        compileSdkVersion safeExtGet('compileSdkVersion', 27)
        buildToolsVersion safeExtGet('buildToolsVersion', '23.0.1')
    
        defaultConfig {
            minSdkVersion safeExtGet('minSdkVersion', 16)
            targetSdkVersion safeExtGet('targetSdkVersion', 27)
            // ...
        }
        // ...
    }

    And in your project's level build.gradle, provide these values:

    buildscript {
      ext {
        targetSdkVersion = 28
        compileSdkVersion = 28
        minSdkVersion = 19
      }
      // ...
    }

@jan-happy
Copy link

Thank you @saplf.
I created a PR with your suggestions:
#368
@ekegodigital 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants