-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Fixed the run-android cli script to start the correct activity when using different applicationId for different variants #8950
Conversation
By analyzing the blame information on this pull request, we identified @burgalon and @jimthedev to be potential reviewers. |
fca786d
to
be2b67c
Compare
From the issue:
What's the reason to change only one and not the other? Do you have an example when you'd do that? This PR contains a lot of code, is there a way to solve this say with a few lines of code? One thing not clear from the description of this PR: what's the new |
Sorry if i'm discussing in wrong place but I also had problems with applicationId as described and this pull request came closest when searching. Our case is that we have same application built for different environments (dev/qa/prod) and we need to install those side-by-side so that is the reason for different applicationIds. If I have understood correctly the applicationId should be decoupled from the Androidmanifest.xml package_name exactly for this kind of purpose. See more: http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename Not experienced enough on Android build systems to comment on actual implementation but would think that simpler option would be just to read straight the applicationId from build.gradle if there is no other problems with it. |
be2b67c
to
26227b6
Compare
@kgritesh updated the pull request - view changes |
const ret = splitVariant(gradleFilePath, variant); | ||
const buildType = ret[0]; | ||
const flavor = ret[1]; | ||
const paths = ['android/app/build/intermediates/manifests/full']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are already in the android directory: https://github.com/facebook/react-native/pull/8950/files#diff-a003f89d34db18b4567fdb55080a003eR81
I believe these two file paths should be app/build.gradle
and app/build/intermediates/manifests/full
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enterline yes you are right these two paths should be app/build.gradle
and app/build/intermediates/manifests/full
. I have updated my PR accordingly.
26227b6
to
3a728fb
Compare
@kgritesh updated the pull request - view changes |
3a728fb
to
818a297
Compare
@kgritesh updated the pull request - view changes |
818a297
to
cc67004
Compare
@kgritesh updated the pull request - view changes |
@mkonicek sorry for missing your comments earlier. As per your other comment about that this pr contains lot of code, i don't think there is a simpler and cleaner way to solve this for all kind of corner cases Finally the --activity options allows you to pass name of your launch activity incase its not called MainActivity. Most common use case is when you are adding react native to an existing app and the default launch activity is named something else |
cc67004
to
9068ddf
Compare
@kgritesh updated the pull request - view changes |
💯 . This fixed my problem. Our build.gradle looks like:
And so on. This PR fixes it perfectly. I worked like mad on #10178 and it just got merged. So should this one. The build scripts in react-native are weak and people like @kgritesh are improving it. Let's get this merged because right now I have to patch it. Thanks @kgritesh for your hard work! |
thanks @StevePotter for your kind words. I am also waiting for this to get merged. |
@kgritesh updated the pull request - view changes |
This fixed our issues, thanks! Note that (at least in Linux), if you run it with Running the task with the variant name in lowercase I think that |
@mkonicek thoughts on this PR? |
using different applicationId for different variants
53c4f9c
to
1350b35
Compare
@mkonicek Any progress on merging this PR? |
Yeah what is going on? This merge request is super old. I already opened a bug about exactly this but it seems like no love for Android in react native :( |
Thanks for the PR. I'd like to push for solving this issue with fewer lines of code as well. |
Hey Hector,
I will submit a new PR by end of this week making this better works?
…On Fri, Jan 20, 2017 at 2:46 AM, Héctor Ramos ***@***.***> wrote:
Thanks for the PR. I'd like to push for solving this issue with fewer
lines of code as well.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8950 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADLpr1wgBLx-plIEyVrZYJ5AjDEgJNAZks5rT9KUgaJpZM4JSGM1>
.
|
Does it need to be a new PR or can you land the commits on this one? |
Hows the work with this going? |
Is this getting anywhere? @kgritesh? Can this be solved with any other solution? @hramos @mkonicek |
Sorry guys for not responding. I will surely try to refix this over next
week and send another PR for latest version of react native.
…On Thu, Feb 23, 2017 at 1:02 AM, Héctor Ramos ***@***.***> wrote:
@Snorlock <https://github.com/Snorlock> @chuyik
<https://github.com/chuyik> the original author has not responded in a
while. If you're interested in fixing this, feel free to send a PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8950 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADLprxAVkZDzxQqWcgtYHlCA1P-2uoZnks5rfI1FgaJpZM4JSGM1>
.
|
It was closed because? |
@Snorlock the author stated multiple times they will open a new PR that addresses the feedback provided above. |
This is a small fix in the runAndroid that instead of using the AndroidManifest file from the src at
app/src/main/AndroidManifest.xml
uses the manifest file that is generated during the build process to find out the correct package name and activity name. As a result, it solves the issue whererunAndroid
command fails to start the app after installing it.Relevant Issue: #5546