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

Is this Library still Active?? If not, can you cancel this. #635

Open
gibo77 opened this issue Jan 2, 2024 · 6 comments
Open

Is this Library still Active?? If not, can you cancel this. #635

gibo77 opened this issue Jan 2, 2024 · 6 comments

Comments

@gibo77
Copy link

gibo77 commented Jan 2, 2024

I used this Library and I opened a can of worms!

I followed how to install this Library. There are so many changes that it broke my program.
The installation instruction is old and not anymore applicable for use.

Now I have an issue that my program can not see the react native gesture handler.

Can someone tell us if this was working for them?

What react-native-splash-screen version are you using?
{
"name": "smartdimmer_ios",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@react-native-community/slider": "^4.4.2",
"@react-navigation/native": "^6.1.7",
"@react-navigation/native-stack": "^6.9.13",
"babel": "^6.23.0",
"base64-js": "^1.5.1",
"buffer": "^6.0.3",
"react": "18.2.0",
"react-native": "0.72.4",
"react-native-gesture-handler": "^2.14.0",
"react-native-reanimated": "^3.5.1",
"react-native-safe-area-context": "^4.7.2",
"react-native-screens": "^3.25.0",
"react-native-size-matters": "^0.4.0",
"react-native-splash-screen": "^3.3.0",
"react-native-udp": "^4.1.7",
"react-native-vector-icons": "^10.0.0",
"upgrade": "^1.1.0"
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/runtime": "^7.21.0",
"@tsconfig/react-native": "^3.0.0",
"@types/jest": "^29.5.1",
"@types/react": "^18.0.38",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.5.0",
"eslint": "8.39.0",
"jest": "^29.5.0",
"metro-react-native-babel-preset": "^0.76.2",
"prettier": "^2.8.8",
"react-native-clean-project": "^4.0.1",
"react-test-renderer": "18.2.0",
"typescript": "^5.0.4"
},
"jest": {
"preset": "react-native"
},
"browser": {
"dgram": "react-native-udp"
},
"resolutions": {
"react-native-gesture-handler": "2.12.1"
}
}

What platform does your issue occur on? Android

Describe your issue as precisely as possible :

  1. Steps to reproduce the issue or to explain in which case you get the issue
    Installed the "react-native-splash-screen": "^3.3.0"
    Did the instructions to change a slew of changes on the Android folders.
  2. Interesting logs
    Suddenly I got this problem
    ERROR [react-native-gesture-handler] react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).

Join a screenshot or video of the problem on the simulator or device?

Show us the code you are using?

@mohshbool
Copy link

you need a workaround to get this working on the latest version of react-native, like the fact that the new react-native uses koltin, not java, which differs a little in the setup for the android. there are also issues with the structure of didFinishLaunchingWithOptions on ios but having had experience with native development with both kotlin and swift, i managed to find workarounds for both issues and it's working wonderfully on 0.73.1. if you're still having problems, please share your MainActivity.kt and AppDelegate.mm files and perhaps the community will help!

@pierroo
Copy link

pierroo commented Feb 7, 2024

Hi @mohshbool , can you let me know how did you manage to use it in Kotlin for the MainActivity.kt?

package com.myappname
import com.facebook.react.ReactActivity

// import android.os.Bundle;
import org.devio.rn.splashscreen.SplashScreen;

import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

class MainActivity : ReactActivity() {
  override fun getMainComponentName(): String = "Bottled"

  // below for splashscreen
  override fun onCreate(savedInstanceState: Bundle?) {
    SplashScreen.show(this)
    super.onCreate(null)
  }

  override fun createReactActivityDelegate(): ReactActivityDelegate =
      DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}

obviously I have added the part

override fun onCreate(savedInstanceState: Bundle?) {
    SplashScreen.show(this)
    super.onCreate(null)
  }

but not sure this is the way to do?

and while at it since you seem to be good with the transition to kotlin, I used to have a function in mainapplication.java for codepush:

 @Override
        protected String getJSBundleFile() {
            return CodePush.getJSBundleFile();
        }

=> how could I have it in the new mainApplication.kt?
I added this right before the onCreate function, not sure it's correct:

 override fun getJSBundleFile(): String? {
      return CodePush.getJSBundleFile()
  }

@mohshbool
Copy link

mohshbool commented Feb 15, 2024

hello @pierroo. what you have implemented up there with your Kotlin code is correct as long as you're adding the import statement at the top of the file. are you getting any errors?

@pierroo
Copy link

pierroo commented Feb 15, 2024

thank you @mohshbool for replying, actually I had to uncomment the "// import android.os.Bundle;" at the top of the file that was necessary :)

@muhammadalizkhan
Copy link

Facing Same Issue,
MainActivity.kt
`package com.splashscreenandappiconapp

import android.os.Bundle;
import com.facebook.react.ReactActivity
import org.devio.rn.splashscreen.SplashScreen;
import com.cboy.rn.splashscreen.SplashScreen;
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

class MainActivity : ReactActivity() {
@OverRide
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this);
super.onCreate(savedInstanceState);
}

/**

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

/**

  • 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)
    }
    `

@Akash-Rathor
Copy link

Akash-Rathor commented Jun 11, 2024

the below mentioned changes helped me resolved the issue. main changes I did related to kotlin (react native 0.74 version related is in file MainActivity.kt.

MainActivity.kt

import org.devio.rn.splashscreen.SplashScreen

class MainActivity : ReactActivity() {
  
  override fun getMainComponentName(): String = "main"

  override fun onCreate(savedInstanceState: Bundle?) {
    SplashScreen.show(this)
    setTheme(R.style.AppTheme);
    super.onCreate(null)
  }

android>settings.gradle

Add these lines.

include ':react-native-splash-screen'   
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')

android>app>build.gradle

dependencies {
    // The version of react-native is set by the React Native Gradle Plugin
    implementation("com.facebook.react:react-android")


    implementation project(':react-native-splash-screen') // new line added inside dependencies

**_... rest of the code_**

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

5 participants