React-native-splash-screen: This package not working for me

Created on 8 Jun 2018  路  6Comments  路  Source: crazycodeboy/react-native-splash-screen

I am install this package using following commands

npm i react-native-splash-screen --save and after that run following command
react-native link react-native-splash-screen

When i run react-native run-android i am getting following error on terminal

screen shot 2018-06-08 at 3 58 31 pm

Most helpful comment

I found this solution.
https://stackoverflow.com/questions/45615474/gradle-error-could-not-find-method-implementation-for-arguments-com-android

I opened node_modules/react-native-splash-screen/android/build.gradle and replaced implementation by compile and testImplementation with testCompile.

Here is my final build.gradle

apply plugin: 'com.android.library'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:27.0.2'
    compile "com.facebook.react:react-native:+"  // From node_modules
}

All 6 comments

I can confirm the bug.

"react-native": "^0.55.4",
"react-native-splash-screen": "^3.0.7",

Not working here too, any ideas?

I found this solution.
https://stackoverflow.com/questions/45615474/gradle-error-could-not-find-method-implementation-for-arguments-com-android

I opened node_modules/react-native-splash-screen/android/build.gradle and replaced implementation by compile and testImplementation with testCompile.

Here is my final build.gradle

apply plugin: 'com.android.library'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:27.0.2'
    compile "com.facebook.react:react-native:+"  // From node_modules
}

I hit this issue yesterday, downgrading to 3.0.6 fixes it.

It looks related to #156 which updated the build.gradle for Gradle 3. React Native ships with Gradle 2 which doesn't support implementation

Beginning with the 3.0.9 version build.gradle will be kept with react-native build.gradle.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jetre219 picture jetre219  路  4Comments

johndo31 picture johndo31  路  3Comments

Dineshchitta picture Dineshchitta  路  5Comments

mharrisweb picture mharrisweb  路  3Comments

ijry picture ijry  路  5Comments