akveo / react-native-ui-kitten

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/react-native-ui-kitten/
MIT License
10.35k stars 958 forks source link

Black screen in startup of app #1776

Open ashadnasim52 opened 1 year ago

ashadnasim52 commented 1 year ago

🐛 Bug Report

When I open the release apk which is made using kitten UI, the app shows a black screen at startup for at least 2 to 4 seconds

To Reproduce

Install Kitten UI and add theme like this

 <ApplicationProvider {...eva} theme={{...eva.light, ...theme}}>
          <NavigationContainer>
            <Main />
          </NavigationContainer>
          <Index />
        </ApplicationProvider>

Expected behavior

no black screen should Come

UI Kitten and Eva version

Package Version

"@ui-kitten/components": "^5.3.1", "@ui-kitten/eva-icons": "^5.3.1", "@eva-design/eva": "^2.2.0",

metro-config code

const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
const MetroConfig = require('@ui-kitten/metro-config');

const evaConfig = {
  evaPackage: '@eva-design/eva',
  // Optional, but may be useful when using mapping customization feature.
  customMappingPath: './mapping.json',
};

// Make sure to handle any errors that might occur during configuration
module.exports = async () => {
  try {
    const defaultConfig = await getDefaultConfig(__dirname);

    // Use mergeConfig from @react-native/metro-config to merge configurations
    const mergedConfig = mergeConfig(defaultConfig, {
      // Add your custom configuration options here if needed
    });

    // Create the final configuration using @ui-kitten/metro-config
    const finalConfig = MetroConfig.create(evaConfig, mergedConfig);

    return finalConfig;
  } catch (error) {
    // Handle errors appropriately, e.g., log them or throw
    console.error('Error configuring Metro bundler:', error);
    throw error;
  }
};
umer-nazir02 commented 2 months ago

@ashadnasim52 Hi, were you able to find a solution?