Open linhuanfeng opened 3 weeks ago
Same here with 0.75.1 and splash screen 3.3.0
same with @linhuanfeng
I think this has to do with the fact that in the latest react native, it's moving from java files to kt files.
This is a repo that doesn't seem to be updated anymore but these are the steps I took.
Although it is not recommended - I added android.enableJetifier=true
to my gradle.properties file
android.useAndroidX=true
android.enableJetifier=true <-- This is the line that is important for the duplicate classes
My android/app/src/main/java/com/
package com.<APP_NAME>
import android.os.Bundle
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
import org.devio.rn.splashscreen.SplashScreen
class MainActivity : ReactActivity() {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "main"
/**
* 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)
override fun onCreate(savedInstanceState: Bundle?) {
SplashScreen.show(this)
super.onCreate(null) // SplashScreen actually will call super.onCreate
}
}
My android/app/src/main/java/com/app_name/SplashActivity.kt my file looks like this
package com.<APP_NAME>;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
class SplashActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState);
val intent = Intent(this, MainActivity::class.java);
startActivity(intent)
finish()
}
}
Fix PR raised, owner Please merge my PR and publish a new version -> https://github.com/crazycodeboy/react-native-splash-screen/pull/650
Fix PR raised, owner Please merge my PR and publish a new version -> #650
I think you should also update the readme for MainActivity.kt
Any ETA for this merge?
Hi will change this by tomorrow
On Mon, 9 Sept 2024, 21:12 Federico Nelli, @.***> wrote:
Any ETA for this merge?
— Reply to this email directly, view it on GitHub https://github.com/crazycodeboy/react-native-splash-screen/issues/649#issuecomment-2338462408, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL6QEJW55R4ALZNCMAVYRY3ZVW6WJAVCNFSM6AAAAABM7I2IWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZYGQ3DENBQHA . You are receiving this because you commented.Message ID: @.***>
Hi, I checked,
No change is required in the README.md file, you can proceed with merge and publish new version
On Mon, Sep 9, 2024 at 9:30 PM Umesh Patidar @.***> wrote:
Hi will change this by tomorrow
On Mon, 9 Sept 2024, 21:12 Federico Nelli, @.***> wrote:
Any ETA for this merge?
— Reply to this email directly, view it on GitHub https://github.com/crazycodeboy/react-native-splash-screen/issues/649#issuecomment-2338462408, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL6QEJW55R4ALZNCMAVYRY3ZVW6WJAVCNFSM6AAAAABM7I2IWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZYGQ3DENBQHA . You are receiving this because you commented.Message ID: @.*** com>
--
Thanks and Regards,Umesh Patidar+91 8319296080
I think this has to do with the fact that in the latest react native, it's moving from java files to kt files.
This is a repo that doesn't seem to be updated anymore but these are the steps I took. Although it is not recommended - I added
android.enableJetifier=true
to my gradle.properties fileandroid.useAndroidX=true android.enableJetifier=true <-- This is the line that is important for the duplicate classes
My android/app/src/main/java/com/
/MainActivity.kt my file looks like this package com.<APP_NAME> import android.os.Bundle import com.facebook.react.ReactActivity import com.facebook.react.ReactActivityDelegate import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled import com.facebook.react.defaults.DefaultReactActivityDelegate import org.devio.rn.splashscreen.SplashScreen class MainActivity : ReactActivity() { /** * Returns the name of the main component registered from JavaScript. This is used to schedule * rendering of the component. */ override fun getMainComponentName(): String = "main" /** * 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) override fun onCreate(savedInstanceState: Bundle?) { SplashScreen.show(this) super.onCreate(null) // SplashScreen actually will call super.onCreate } }
My android/app/src/main/java/com/app_name/SplashActivity.kt my file looks like this
package com.<APP_NAME>; import android.content.Intent; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; class SplashActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState); val intent = Intent(this, MainActivity::class.java); startActivity(intent) finish() } }
thank you!! i updated my MainActivity.kt and it work fine
Thank you,
When are you planning to merge this code? Also I think it is breaking changes also, so we should update major version also
On Tue, 10 Sept 2024, 10:10 Nguyễn Xuân An, @.***> wrote:
I think this has to do with the fact that in the latest react native, it's moving from java files to kt files.
This is a repo that doesn't seem to be updated anymore but these are the steps I took. Although it is not recommended https://developer.android.com/jetpack/androidx/migrate- I added android.enableJetifier=true to my gradle.properties file
android.useAndroidX=trueandroid.enableJetifier=true <-- This is the line that is important for the duplicate classes
My android/app/src/main/java/com/
/MainActivity.kt my file looks like this package com.
import android.os.Bundle import com.facebook.react.ReactActivity import com.facebook.react.ReactActivityDelegate import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled import com.facebook.react.defaults.DefaultReactActivityDelegate
import org.devio.rn.splashscreen.SplashScreen
class MainActivity : ReactActivity() {
/**
- Returns the name of the main component registered from JavaScript. This is used to schedule
rendering of the component. */ override fun getMainComponentName(): String = "main"
/**
- 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)
override fun onCreate(savedInstanceState: Bundle?) { SplashScreen.show(this) super.onCreate(null) // SplashScreen actually will call super.onCreate }
}
My android/app/src/main/java/com/app_name/SplashActivity.kt my file looks like this
package com.
; import android.content.Intent; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity;
class SplashActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState); val intent = Intent(this, MainActivity::class.java); startActivity(intent) finish() }
}
thank you!! i updated my MainActivity.kt and it work fine
— Reply to this email directly, view it on GitHub https://github.com/crazycodeboy/react-native-splash-screen/issues/649#issuecomment-2339594548, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL6QEJSU3J5WDEI6I2OQXX3ZVZZ3RAVCNFSM6AAAAABM7I2IWKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZZGU4TINJUHA . You are receiving this because you commented.Message ID: @.***>
Run
react-native info
in your project and share the content.What
react-native-splash-screen
version are you using?What platform does your issue occur on? (Android/iOS/Both)
Describe your issue as precisely as possible : 1) Steps to reproduce the issue or to explain in which case you get the issue 2) Interesting
logs
As long as I add the dependency yarn add reactive plasma screen, the project will fail to start failed to launch project
Join a screenshot or video of the problem on the simulator or device?
Show us the code you are using?