zoontek / react-native-bootsplash

🚀 Show a splash screen during app startup. Hide it when you are ready.
MIT License
3.74k stars 258 forks source link

Build is failing with error due this package #616

Closed naresh1054 closed 3 months ago

naresh1054 commented 3 months ago

Before submitting a new issue

Bug summary

Projects/DaySync/android/app/src/main/java/com/daysync/MainActivity.kt:13:29 Too many arguments for public open fun init(p0: Activity): Unit defined in com.zoontek.rnbootsplash.RNBootSplash

FAILURE: Build failed with an exception.

BUILD FAILED in 2s

Library version

4.1.15

Environment info

i am debugging on pixel 7 device.

Steps to reproduce

  1. npx react-native start --reset-cache

Reproducible sample code

package com.daysync

import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
import android.os.Bundle
import com.zoontek.rnbootsplash.RNBootSplash

class MainActivity : ReactActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
    RNBootSplash.init(this, R.style.BootTheme) // ⬅️ initialize the splash screen
    super.onCreate(savedInstanceState) // super.onCreate(null) with react-native-screens
  }

  /**
   * Returns the name of the main component registered from JavaScript. This is used to schedule
   * rendering of the component.
   */
  override fun getMainComponentName(): String = "DaySync"

  /**
   * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
   * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
   */
  override fun createReactActivityDelegate(): ReactActivityDelegate =
      DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}
zoontek commented 3 months ago

I cannot reproduce. Check the setup step, clean your gradle cache, rebuild, it should be fine.