Jul 18 | 8:50 AM |
Mark M. | has entered the room |
Jul 18 | 8:55 AM |
Mark M. | turned on guest access |
Jul 18 | 9:00 AM |
Erik | has entered the room |
Mark M. |
hello, Erik!
|
Erik |
hey mark
|
Mark M. |
how can I help you today?
|
Erik |
a couple days ago I asked you about excluding a flavor specific test dir from my compile task. Do you remember?
|
Mark M. |
yes
|
Mark M. |
IIRC, we didn't resolve it
|
Erik |
no but you asked me to create a minimum test project. I tried it out and found out a couple things.
|
Jul 18 | 9:05 AM |
Erik |
View paste
|
Shawn V. | has entered the room |
Shawn V. |
Good morning
|
Mark M. |
(BTW, hello Shawn -- I will be with you shortly!)
|
Mark M. |
Erik: OK, I don't completely follow that, but if it is helping you, great!
|
Shawn V. |
No worries.
|
Erik |
well it does not work because the compile task still tries to compile androidTest
|
Erik |
so even if something is hidden from a sourceSet the compile task can still try to build that hidden dir
|
Mark M. |
I am not certain how are you "hiding" things with the above syntax
|
Mark M. |
+= adds stuff to the source set, so anything already there should remain there AFAIK
|
Mark M. |
I've just reviewed our previous chat, and I don't have any new insights
|
Jul 18 | 9:10 AM |
Erik |
i dont know either but uncomenting srcDirs += 'src' does what the comments describe. the first line is the default directory structure. the second line is what happens if you uncomment that line
|
Mark M. |
¯\_(ツ)_/¯
|
Erik |
ok
|
Erik |
i appreciate it anyway
|
Erik |
goodbye
|
Erik | has left the room |
Mark M. |
about the only other suggestion that I can make is to move your Kotlin code back into java/ directories, instead of kotlin/ directories, and see if that allows you to simplify your setup
|
Mark M. |
ugh, didn't type fast enough :-(
|
Mark M. |
Shawn: hi! how can I help you today?
|
Shawn V. |
My issue is the following. I have a long running video player. Since the video player APK has references to android.webkit, when Google provides updates, the application crashes and resets since it has dependencies on the android.webkit. Last week, when we spoke, you pointed out I could use AnalyzeAPK to help with the removal or references of android.webkit. That has helped. However, with some of the references I have left, they seem to point to libraries that I don't have directly listed in any build.gradle script. Am I missing a tool or using some other method to help me track this down. I can describe a specific situation if that helps.
|
Mark M. |
"they seem to point to libraries that I don't have directly listed in any build.gradle script" -- those could be transitive dependencies from others that you are including directly
|
Mark M. |
"Am I missing a tool or using some other method to help me track this down" -- you can run a Gradle dependency report to see the whole tree of dependencies
|
Shawn V. |
Ah, how would I do that?
|
Mark M. |
run the dependencies task for your module
|
Mark M. |
from inside Android Studio, if you go into the Gradle tool window, under your module, inside the "help" category, you will find "dependencies"
|
Mark M. |
run that, and you will get a dependency tree for each build variant, including test ones
|
Jul 18 | 9:15 AM |
Mark M. |
the dependency tree is rendered in an ASCII-art sort of tree structure, showing what pulls in what
|
Shawn V. |
I understand what you are saying, but I don't know the specific actions to perform. I apoligize
|
Mark M. |
do you have Android Studio open?
|
Shawn V. |
Yes
|
Mark M. |
on the right edge, do you have a "Gradle" vertical button?
|
Shawn V. |
Yes
|
Shawn V. |
I clicked it
|
Mark M. |
OK, so that should show you a tree, rooted with your project, and with at least two immediate children: one for the project itself and one for each of your modules
|
Shawn V. |
Yes, I see that and have found the tree for my module
|
Mark M. |
go into Tasks > help
|
Mark M. |
you should seen an entry in there named "dependencies"
|
Shawn V. |
I went to tasks and help and I see dependencies
|
Mark M. |
double-click that to run that task
|
Shawn V. |
9:19:39 AM: Task execution finished 'dependencies'.
|
Jul 18 | 9:20 AM |
Mark M. |
that emitted two tons of text into the Run console output
|
Shawn V. |
It printed many things and finished
|
Mark M. |
basically, there is one stanza for every build type + test type + classpath type combination
|
Mark M. |
look for debugRuntimeClasspath
|
Mark M. |
Ctrl-F (or the equivalent on macOS) should work to allow you to search in the Run output
|
Shawn V. |
debugRuntimeClasspath - Resolved configuration for runtime for variant: debug
|
Shawn V. |
Found it
|
Mark M. |
and under that heading, you should see a tree structure
|
Shawn V. |
I definitely see that
|
Mark M. | |
Mark M. |
the lines that are left-flush and start with things like +--- represent your direct dependencies, the ones you have in your build.gradle file
|
Mark M. |
the indented ones represent transitive dependencies, what each direct dependency itself depends upon
|
Mark M. |
View paste
|
Shawn V. |
I see that
|
Mark M. |
there, my project depends on androidx.room:room-rxjava2:2.1.0
|
Mark M. |
and that artifact pulls in five more, with io.reactivex.rxjava2:rxjava pulling in yet another one
|
Jul 18 | 9:25 AM |
Mark M. |
so, when analyzing the APK, if you do not recognize where some class is coming from, it could be *any* of these dependencies, both the direct ones and the transitive ones
|
Mark M. |
however, in terms of how to map from a class name to an artifact... other than "search Google", there isn't a great answer
|
Mark M. |
at least, none that I know of
|
Shawn V. |
For my specific example, in AnalyzeAPK, I saw a reference that listed a generated method zzzqa or something like that, when I searched that method, Android studio opened a generated file when I scrolled up, that method traced up to gms-ads-lite. But I don't see that in this dependency list
|
Mark M. |
cryptic ones like that may represent a library where somebody used ProGuard on the library that they shipped
|
Mark M. |
Google does this with Play Services, for example
|
Mark M. |
so, gms-ads-lite is part of Play Services
|
Mark M. |
(at least, I assume, given that name)
|
Shawn V. |
That makes sense. Should I see that library in the dependency list as a separate item
|
Mark M. |
perhaps under a different name
|
Mark M. |
search for play-services-ads-lite
|
Mark M. |
or perhaps just ads-lite
|
Shawn V. |
I just did an easy search. It didn't find any 'ads' and the only 'lite' was +--- com.google.protobuf:protobuf-lite:3.0.1
|
Mark M. |
OK, I can't explain that
|
Jul 18 | 9:30 AM |
Shawn V. |
It's okay, this is another tool to help me.
|
Mark M. |
from what I understand, ad libraries often use WebView, so for your overall "know what is using WebView" mission, any ad library that you may be using would be suspect
|
Shawn V. |
In analyzeApk, if I find a reference that traces down to a unique method name and I search for that method name and the tool decompiles a generated file for that name and that appears in the left pane and traces up to a library, is that a valid way to use the tool.
|
Shawn V. |
That makes sense
|
Mark M. |
I'm skeptical about the "traces up to a library" part, but the decompiled class is typical, if source is not available for that (either yours or from a sources.jar as part of the artifact)
|
Shawn V. |
I wish there was a way to configure the Android OS to not allow updates to specific things like android.webkit. But that is probably not doable
|
Mark M. |
if you control the hardware/firmware, there may be options for that, but that's outside of my area of expertise
|
Shawn V. |
I understand.
|
Mark M. |
if this is off-the-shelf hardware, and your app is effectively an ordinary app, I cannot think of a way to control what you want
|
Mark M. |
IIRC, your problem is that when WebKit updates, your process gets terminated -- do I have that correct?
|
Shawn V. |
Yes, that is the base problem.
|
Shawn V. |
And since the video player should be available to the user on an Android TV device, it isn't as "acceptable" as it happening on a phone, etc
|
Mark M. |
a foreground sticky service might get Android to at least restart the process, though it would only directly start the service
|
Jul 18 | 9:35 AM |
Shawn V. |
It restarts and resumes right after
|
Mark M. |
OK, so you're just trying to avoid the hiccup at the point of the actual update?
|
Shawn V. |
If the user wasn't watching during those 30 seconds or so, they would never know
|
Shawn V. |
That is my task :)
|
Shawn V. |
Exactly
|
Mark M. |
is your app available for any Android TV, or is this some specific box that you're working with?
|
Shawn V. |
Unfortunately, it is a specific piece of hardware as well.
|
Mark M. |
actually, that's a benefit in this case
|
Mark M. |
one would expect automatic app updates to occur when the device is not in use
|
Mark M. |
have you talked to the manufacturer about this update timing issue?
|
Shawn V. |
The update seems to be coming from Google. It isn't coming from the manufacturer since we control that aspect.
|
Mark M. |
I would hope that there would be some amount of device-level configuration for when the Play Store downloads and installs updates
|
Mark M. |
if you need assistance with that sort of stuff, try Opersys (Karim Yaghmour)
|
Shawn V. |
I would hope so too, I haven't investigatesd that area of the problem yet.
|
Shawn V. |
Thanks for the pointer.
|
Shawn V. |
I appreciate that
|
Jul 18 | 9:40 AM |
Shawn V. |
Thank you for your time and I hope you have a great morning.
|
Mark M. |
I approach Android top-down from the app level; Karim approaches Android bottom-up from the firmware level
|
Mark M. |
I hope you have a nice... whatever day unit you're in :-)
|
Shawn V. |
Eastern Time - Florida
|
Mark M. |
oof -- try not to melt
|
Shawn V. |
I like the heat and humidity. Places like Colorado make me feel like I will crack open it is so dry.
|
Jul 18 | 10:00 AM |
Shawn V. | has left the room |
Mark M. | turned off guest access |