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

Header search bar not working on Android #1906

Closed
APZelos opened this issue Sep 28, 2023 · 6 comments
Closed

Header search bar not working on Android #1906

APZelos opened this issue Sep 28, 2023 · 6 comments
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided

Comments

@APZelos
Copy link

APZelos commented Sep 28, 2023

Description

The headerSearchBarOptions options doesn't seem to have any effect on Android, while on iOS works fine.
Here is my navigator:

import React from 'react';
import {Text, View} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';

const Stack = createNativeStackNavigator();

function Home() {
  return (
    <View>
      <Text>Header Search Bar</Text>
    </View>
  );
}

function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator>
        <Stack.Screen
          name="Home"
          component={Home}
          options={{headerSearchBarOptions: {}}}
        />
      </Stack.Navigator>
    </NavigationContainer>
  );
}

Also I'm getting these warnings when building Android:

yarn run v1.22.19
$ react-native run-android
info JS server already running.
info Installing the app...

> Task :react-native-screens:processDebugManifest
package="com.swmansion.rnscreens" found in source AndroidManifest.xml: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

> Task :react-native-safe-area-context:processDebugManifest
package="com.th3rdwave.safeareacontext" found in source AndroidManifest.xml: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-safe-area-context/android/src/main/AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

> Task :react-native-safe-area-context:compileDebugKotlin
'compileDebugJavaWithJavac' task (current target is 11) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-safe-area-context/android/src/main/java/com/th3rdwave/safeareacontext/SafeAreaView.kt: (58, 23): 'getter for uiImplementation: UIImplementation!' is deprecated. Deprecated in Java

> Task :react-native-screens:compileDebugKotlin
'compileDebugJavaWithJavac' task (current target is 11) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/Screen.kt: (77, 22): 'constructor GuardedRunnable(ReactContext!)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt: (62, 28): 'setter for targetElevation: Float' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt: (119, 28): 'setter for targetElevation: Float' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt: (85, 34): 'getter for systemWindowInsetTop: Int' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt: (227, 37): 'setColorFilter(Int, PorterDuff.Mode): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt: (65, 22): 'constructor GuardedRunnable(ReactContext!)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt: (110, 22): 'constructor GuardedRunnable(ReactContext!)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt: (137, 47): 'replaceSystemWindowInsets(Int, Int, Int, Int): WindowInsetsCompat' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt: (138, 51): 'getter for systemWindowInsetLeft: Int' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt: (140, 51): 'getter for systemWindowInsetRight: Int' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt: (141, 51): 'getter for systemWindowInsetBottom: Int' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt: (100, 22): Parameter 'view' is never used
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt: (100, 43): Parameter 'placeholder' is never used
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt: (141, 43): Parameter 'flag' is never used
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt: (7, 42): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt: (17, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt: (18, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt: (7, 51): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt: (17, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt: (18, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt: (7, 42): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt: (17, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt: (18, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenAppearEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenAppearEvent.kt: (7, 40): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenAppearEvent.kt: (13, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenAppearEvent.kt: (14, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenDisappearEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenDisappearEvent.kt: (7, 43): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenDisappearEvent.kt: (13, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenDisappearEvent.kt: (14, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenDismissedEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenDismissedEvent.kt: (7, 43): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenDismissedEvent.kt: (13, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenDismissedEvent.kt: (17, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt: (13, 5): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt: (22, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt: (27, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillAppearEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillAppearEvent.kt: (7, 44): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillAppearEvent.kt: (13, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillAppearEvent.kt: (14, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillDisappearEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillDisappearEvent.kt: (7, 47): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillDisappearEvent.kt: (13, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillDisappearEvent.kt: (14, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt: (7, 41): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt: (17, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt: (18, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt: (10, 5): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt: (20, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt: (23, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt: (7, 42): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt: (17, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt: (18, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt: (7, 42): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt: (17, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt: (18, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt: (7, 41): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt: (17, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt: (18, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt: (7, 81): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt: (17, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt: (20, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/StackFinishTransitioningEvent.kt: (5, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/StackFinishTransitioningEvent.kt: (7, 52): 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/StackFinishTransitioningEvent.kt: (13, 44): 'RCTEventEmitter' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/events/StackFinishTransitioningEvent.kt: (14, 25): 'receiveEvent(Int, String!, WritableMap?): Unit' is deprecated. Deprecated in Java
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt: (7, 42): Parameter 'width' is never used
w: /Users/alkis/repos/zelosee/AndroidHeaderSearchBar/node_modules/react-native-screens/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt: (7, 54): Parameter 'height' is never used

> Task :app:installDebug
Installing APK 'app-debug.apk' on 'Pixel_2_API_32(AVD) - 12' for :app:debug
Installed on 1 device.
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 9s
76 actionable tasks: 40 executed, 36 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5556"...
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.androidheadersearchbar/.MainActivity }
✨  Done in 17.00s.

Steps to reproduce

  1. Add and setup react-native-screens react-native-safe-area-context @react-navigation/native-stack dependencies
  2. Create a stack navigation that uses headerSearchBarOptions
  3. Run on Android

Snack or a link to a repository

https://github.com/APZelos/android-header-search-bar

Screens version

3.25.0

React Native version

0.72.5

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

Android emulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Repro provided A reproduction with a snack or repo is provided Platform: Android This issue is specific to Android labels Sep 28, 2023
@tboba
Copy link
Member

tboba commented Sep 29, 2023

Hi @APZelos, thanks for reporting that! This issue has been fixed on #1883 and will land on the newest version of react-native-screens. We're also aware of the warnings and we plan to reduce them.

Thanks!

@tboba tboba closed this as completed Sep 29, 2023
@aleor
Copy link

aleor commented Oct 12, 2023

@tboba Sorry, is there any way to get it working while waiting for the new version of react-native-screens?
I've tried to roll back to version 3.22.1, but it didn't help - I still can't see SearchBar on Android.

@aleor
Copy link

aleor commented Oct 12, 2023

Found the solution: roll back to @react-navigation/[email protected] solved the issue.

Version 6.9.14 (https://github.com/react-navigation/react-navigation/releases?q=6.9.14&expanded=true) got this change included: #1825, so doesn't work properly.

@tboba
Copy link
Member

tboba commented Oct 17, 2023

Hi @aleor @APZelos, sorry you had to wait! There's new release of react-native-screens: 3.26.0 where this change is included. Check it out! If you find something wrong related to the newest version (this change is still buggy or doesn't work for you) let us know 🎉

@ysnbyzli
Copy link

@tboba Hi 👋🏻, I using react-native-navigation on my expo project. When use headerSearchBarOptions not showing search icon on screen header. As you said, when I change the react-native-screens version to 3.26.0, the application stays in the splash screen, which means it crashes. So I'm using the latest version but again the search function still doesn't work.

Thank you for your interest 🙏🏻

"dependencies": {
    "@expo/vector-icons": "^13.0.0",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/native-stack": "^6.9.17",
    "@reduxjs/toolkit": "^2.0.1",
    "@shopify/flash-list": "1.4.3",
    "expo": "~49.0.15",
    "expo-font": "~11.4.0",
    "expo-splash-screen": "~0.20.5",
    "expo-sqlite": "~11.3.3",
    "expo-status-bar": "~1.6.0",
    "react": "18.2.0",
    "react-native": "0.72.6",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-reanimated": "~3.3.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "^3.29.0",
    "react-redux": "^9.0.4"
  }
useLayoutEffect(() => {
    navigation.setOptions({
      headerLargeTitle: true,
      headerSearchBarOptions: {
        inputType: "text",
        cancelButtonText: "İptal",
        tintColor: colors.primary,
        placeholder: "Ürün ara",
        onChangeText: (event) => {
          setSearch(event.nativeEvent.text);
        },
        onFocus: () => {
          setIsSearchFocused(true);
        },
        onBlur: () => {
          setIsSearchFocused(false);
        },
        hideWhenScrolling: false
      }
    });
  }, [navigation, colors]);

@tboba
Copy link
Member

tboba commented Dec 23, 2023

@ysnbyzli Hi, thanks for mentioning about that. Can you check if the search bar works for you in the newest version of screens (3.29.0)? Also, your app should not crash there 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

No branches or pull requests

4 participants