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

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

Closed
ezekel opened this issue Sep 21, 2020 · 28 comments
Closed

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

ezekel opened this issue Sep 21, 2020 · 28 comments

Comments

@ezekel
Copy link

ezekel commented Sep 21, 2020

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
Copy link

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

  • react-native-vector-icons

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:

  • react-native-paper (found: 4.1.0, latest: 4.2.0)

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

@github-actions
Copy link

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

  • react-native-paper (found: 4.1.0, latest: 4.2.0)

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

@ezekel
Copy link
Author

ezekel commented Sep 21, 2020

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

@ezekel ezekel changed the title Theme not working when generating signed APK Theme not working when generating signed APK RNP v. 4.2.0 Sep 21, 2020
@ezekel ezekel changed the title Theme not working when generating signed APK RNP v. 4.2.0 Theme not working when generating signed APK RNP 4.2.0 Sep 21, 2020
@ezekel
Copy link
Author

ezekel commented Sep 21, 2020

@satya164 , please help

@ezekel ezekel changed the title Theme not working when generating signed APK RNP 4.2.0 Theme not working when generating release build APK RNP 4.2.0 Sep 21, 2020
@JonatanSalas
Copy link

JonatanSalas commented Sep 29, 2020

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
Copy link

same here
Default theme only after build

@actuallymentor
Copy link

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
Copy link

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
Copy link

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
Copy link

lucascampelo commented Oct 29, 2020

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
Copy link

hirbod commented Nov 15, 2020

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

@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label Jan 15, 2021
@hirbod
Copy link

hirbod commented Jan 15, 2021

Still relevant, still unanswered

@lucascampelo
Copy link

Issue persist on react-native-paper@^4.7.0

@hirbod
Copy link

hirbod commented Jan 20, 2021

@satya164 could you have a look at this?

@satya164
Copy link
Member

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
Copy link

hirbod commented Jan 20, 2021

Thanks, I'll leave a comment there

@lucascampelo
Copy link

lucascampelo commented Jan 31, 2021

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
Copy link

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

@kidculli
Copy link

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
Copy link

hirbod commented Nov 29, 2021

Looks like this issue is still unresolved, right?

@kidculli
Copy link

Looks like this issue is still unresolved, right?

Yep I ran into it today and found this issue

@raajnadar
Copy link
Collaborator

is this happening with latest version?

@kidculli
Copy link

kidculli commented Dec 2, 2021

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

@Bashin
Copy link

Bashin commented Aug 8, 2022

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

@lukewalczak
Copy link
Member

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

@kaisoapbox
Copy link

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
Copy link

avtarvikas commented May 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests