react-native-splash-screen icon indicating copy to clipboard operation
react-native-splash-screen copied to clipboard

Problem with inputs render

Open SantiSarmiento opened this issue 1 year ago • 11 comments

I follow the steps on the github repo but the problem stills.

My problem occurs after installing and configuring React Native Splash Screen in my application. I followed all the steps correctly, and when I launch the app, the image I chose is displayed. However, when navigating between screens, if the screen contains an Input tag (I use the NativeBase library, but I also tried with the React component and encountered the same error), the app crashes and displays the following error message:

error

build.gradle file:

build gradle

settings.gradle file:

settings gradle

MainActivity.java file:

MainActivity

launch_screen.xml file:

launch screen

proyect structure:

proyect structure

"Can you see anything wrong? Any ideas or suggestions?

SantiSarmiento avatar Aug 04 '23 13:08 SantiSarmiento

same problem here =/

herbertcordeiro avatar Aug 14 '23 13:08 herbertcordeiro

Try to use this launch_screen.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/screen" android:scaleType="centerCrop" />
</LinearLayout>

kelokchan avatar Aug 15 '23 10:08 kelokchan

Try to use this launch_screen.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/screen" android:scaleType="centerCrop" />
</LinearLayout>

Still the same problem, just changes that: "Class not found LinearLayout" :(

herbertcordeiro avatar Aug 15 '23 12:08 herbertcordeiro

Try to use this launch_screen.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/screen" android:scaleType="centerCrop" />
</LinearLayout>

Already try that: Class not found LinearLayout

SantiSarmiento avatar Aug 15 '23 12:08 SantiSarmiento

did i remake the installation, adding color.xml that i've forgot and putting android:windowIsTranslucent = true on styles.xml. Now all is fine.

phvasconcellos84 avatar Aug 26 '23 02:08 phvasconcellos84

@phvasconcellos84, I'm also facing the same issue while using TextInput with navigation, as you have a workaround to this issue, I tried your approach to set android:windowIsTranslucent to true on styles.xml as,

< item name="android:windowIsTranslucent" > true </ item>

But this is still not working!

So can you please provide the code changes here, so that we can make the same changes and try this? Or else paste all the splash screen-related changes such as changes in the Android manifest file, and styles.xml file.

GaneshBorkar6 avatar Oct 06 '23 06:10 GaneshBorkar6

Has anyone found a solution? I've just hit the same error... My settings are the same as those of the post creator.

Digital-Human-BK avatar Nov 07 '23 09:11 Digital-Human-BK

Yep, same error, changing to LinearLayout just changed the error: image

fershibli avatar Nov 20 '23 17:11 fershibli

it seems to crash on screens that use TextInput The following worked perfectly for me

*see links below https://stackoverflow.com/questions/76773115/relativelayout-error-from-textinput-and-launch-screen-file/76879105#76879105

sunjaaa avatar Nov 22 '23 02:11 sunjaaa

it seems to crash on screens that use TextInput The following worked perfectly for me

*see links below https://stackoverflow.com/questions/76773115/relativelayout-error-from-textinput-and-launch-screen-file/76879105#76879105

You're amazing! TYSM! It worked perfectly. But why were we using this line on styles.xml? Is this a diference on the setup for previous versions? This should be highlighted on README.md

fershibli avatar Nov 22 '23 14:11 fershibli

In my case, it was due to the following line in styles.xml. Removing this line resolved the issue:

<item name="android:editTextBackground">@layout/launch_screen</item>

This line is mentioned in some old documentation and blogposts, but is not necessary (anymore). Just adding launch_screen.xml in the layout directory, works fine.

fikkatra avatar Dec 18 '23 10:12 fikkatra