Timeline for How can you get the Manifest Version number from the App's (Layout) XML variables?
Current License: CC BY-SA 3.0
22 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 5, 2019 at 13:32 | comment | added | Andris | Wow, great solution!!! Only bad thing is that AndroidStudio thinks that string is not recognised, but apk generates as it should! | |
Dec 21, 2018 at 2:07 | comment | added | Koorosh | this is the best solution , with this solution we can show different versions for different variants | |
Aug 25, 2017 at 19:16 | comment | added | Patrick | Didn't work for me. Tried to use it in my TextView but it says "No resource found that matches the given name (at 'text' with value '@string/versionName')." | |
Apr 13, 2017 at 7:27 | comment | added | A_rmas | @ArunElectra it is cannot resolve symbol. but it allows run and generate apk. it is just the marking of error. | |
Apr 4, 2017 at 9:10 | comment | added | Arun Shankar | @A_rmas what is the error showing when you hover on the red highlight? | |
Apr 4, 2017 at 8:38 | comment | added | A_rmas | It worked but showing red mark|| error in xml though it runs | |
Apr 3, 2017 at 21:29 | comment | added | pepan | This should be considered the best answer. | |
Nov 23, 2016 at 15:49 | comment | added | Arun Shankar | I am using the latest and still works for me. I use this and several other variables like this. @k2col what error do u get while compiling? Pls post ur gradle code | |
Nov 23, 2016 at 14:03 | comment | added | k2col | this seemed like a great answer when I read it but sadly it doesn't work, at least not in the latest Android Studio. | |
Nov 6, 2016 at 6:26 | comment | added | Arun Shankar |
@DenisGL have you add variant.resValue "string", "versionName", variant.versionName in build.gradle ?
|
|
Nov 5, 2016 at 17:20 | comment | added | DenisGL | When I use this string in a layout, I get a warning from Android Studio: "Couldn't resolve resource @string/version_name". Any idea how to get rid of it? | |
S May 11, 2016 at 22:07 | history | suggested | Neurotransmitter | CC BY-SA 3.0 |
Provided example of how this can be included in the actual XML
|
May 11, 2016 at 21:06 | review | Suggested edits | |||
S May 11, 2016 at 22:07 | |||||
S May 11, 2016 at 15:51 | history | suggested | Neurotransmitter | CC BY-SA 3.0 |
Added build.gradle example.
|
May 11, 2016 at 14:10 | review | Suggested edits | |||
S May 11, 2016 at 15:51 | |||||
S May 11, 2016 at 14:06 | history | suggested | Neurotransmitter | CC BY-SA 3.0 |
Elaborated a bit.
|
May 11, 2016 at 13:22 | review | Suggested edits | |||
S May 11, 2016 at 14:06 | |||||
May 11, 2016 at 10:29 | review | Suggested edits | |||
May 11, 2016 at 13:10 | |||||
May 10, 2016 at 21:28 | comment | added | Neurotransmitter | This is better, than programmatic style. | |
May 6, 2016 at 18:24 | comment | added | Arun Shankar | @DenisGL michiganlabs.com/… | |
May 6, 2016 at 17:55 | comment | added | DenisGL | Could you explain the "magic" (or my Gradle ignorance ;-) behind these lines? | |
Apr 7, 2016 at 6:48 | history | answered | Arun Shankar | CC BY-SA 3.0 |