callstack / react-native-paper

Material Design for React Native (Android & iOS)
https://reactnativepaper.com
MIT License
12.5k stars 2.05k forks source link

Theme not working when generating release build APK RNP 4.2.0 #2246

Closed ezekel closed 1 year ago

ezekel commented 3 years ago

Hi after issuing this command npx react-native run-android --variant=release and install the release apk to my real device the theme is not working

RN version : react-native@0.63.2

RNP version: react-native-paper@4.2.0

react-native-vector-icons:react-native-vector-icons@7.1.0 Header is black instead default color purplr image

but in emulator it works

image

github-actions[bot] commented 3 years ago

Couldn't find version numbers for the following packages in the issue:

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

github-actions[bot] commented 3 years ago

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

ezekel commented 3 years ago

Not working in react-native-paper react-native-paper@4.2.0

ezekel commented 3 years ago

@satya164 , please help

JonatanSalas commented 3 years ago

It appears to be a trouble with the babel.config.js, I've removed the react-native-paper/babel from my babel.config.js and it seems to work properly when I perform a production build.

MohammedFaragallah commented 3 years ago

same here Default theme only after build

actuallymentor commented 3 years ago

I notice that a bunch of my theme doesn't work in production builds (fine in test builds).

Is it safe to just remove react-native-paper/babel? What does that plugin usually do?

JonatanSalas commented 3 years ago

I don't know if it is safe to remove it. I think that the plugin might remove unused components and perform other optimizations behind the scenes, but as workaround for now it works well.

actuallymentor commented 3 years ago

I don't know if it is safe to remove it. I think that the plugin might remove unused components and perform other optimizations behind the scenes, but as workaround for now it works well.

I can confirm my apps do build and run, but it's a bit distressing that such a central plugin to the package is malfunctioning on production.

lucascampelo commented 3 years ago

I'm having a similar trouble using expo and react-native-paper. After build the cards of paper are rendering on dark theme even forcing a light theme on expo app.json and using DefaultTheme from react-native-paper. I can't reproduce this on development mode.

I'm using react-native-paper@3.11.0 and expo@39.0.3

I'm not sure if is the same issue anyway.

hirbod commented 3 years ago

I have the same issue, I was getting crazy finding the issue. The Babel-Thing is a good workaround for now.

github-actions[bot] commented 3 years ago

Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.

hirbod commented 3 years ago

Still relevant, still unanswered

lucascampelo commented 3 years ago

Issue persist on react-native-paper@^4.7.0

hirbod commented 3 years ago

@satya164 could you have a look at this?

satya164 commented 3 years ago

Please don't ping me. There are other maintainers in this repo as well, and maintainers get notifications for every issue.

If you want more attention on an issue, you should join the discord and post there https://discord.gg/zwR2Cdh

hirbod commented 3 years ago

Thanks, I'll leave a comment there

lucascampelo commented 3 years ago

I have the same issue, I was getting crazy finding the issue. The Babel-Thing is a good workaround for now.

@Hirbod I've tried here, but still have the problem here. Can you explain the workaround ?

projit-thetaonelab commented 3 years ago

Same issue. Only work around is use, AppRegistry.registerComponent(appName, () => App); as other paper components works fine without the theme.

kidculli commented 2 years ago

I have the same issue, I was getting crazy finding the issue. The Babel-Thing is a good workaround for now.

@Hirbod I've tried here, but still have the problem here. Can you explain the workaround ?

The work around is to remove this from your babel.config.js file. Removing this plugin does cause the release app size to increase significantly.

  env: {
    production: {
      plugins: ['react-native-paper/babel'],
    },
  },
hirbod commented 2 years ago

Looks like this issue is still unresolved, right?

kidculli commented 2 years ago

Looks like this issue is still unresolved, right?

Yep I ran into it today and found this issue

raajnadar commented 2 years ago

is this happening with latest version?

kidculli commented 2 years ago

I tried with 4.9.2 I can try with the latest @raajnadar

Bashin commented 1 year ago

Still an issue with 4.12.4 Build only shows default theme with 'react-native-paper/babel' in the babel.config.js

lukewalczak commented 1 year ago

Does the issue exist with the react-native-paper latest version?

kaisoapbox commented 11 months ago

This issue still exists with the latest version of react-native-paper@5.10.0 @lukewalczak. As before, removing the babel plugin restores proper theming behaviour.

My environment:

"react": "18.2.0",
"react-native": "0.72.3",
"react-native-paper": "5.10.0",
"react-native-vector-icons": "10.0.0",
avtarvikas commented 1 month ago

facing the same issue in the version react-native-paper : 5.11.4