Problems installing Android security provider

Oh, actually, try adding <ExcludeGradleDependency Include="com.android.support"/> to your project, that might already do the trick…

Please correct me if I’m wrong, but wouldn’t that exclude com.android.support dependency for the whole project? It only has to be excluded for GPS, I need com.android.support for the main project.

Test projects coming up shortly.

This only affects indirect dependencies. Your direct reference to the package would still work.

Ok, I’ll try that before creating test projects.

If that does not work, also try using the full package name of the offending package (e.g. <ExcludeGradleDependency Include="com.android.support:whatever"/> .

I couldn’t make it work with your last suggestion.

Test projects for Fire .2351 and Android Studio are attached. Fire fails on ProviderInstaller.installIfNeeded in MainActivity.onCreate, while Android Studio works. However, if I exclude com.android.support from build.gradle in Android Studio, the project won’t even compile. If I add <ExcludeGradleDependency Include="com.android.support" /> to the Fire project, it will compile but with 197 hints. TBH I have no idea if Fire problem is even related to conflict between android support library and Google Play Services, but both projects are configured similarly (I think) so I hope you’ll be able to make something out of them.

Oh, and breakpoints in Fire project still don’t work. They work most of the time in my app’s project if I rebuild it, but after a few runs they eventually stop working until next rebuild. If I create a new project (like the one attached) I can’t make any breakpoint work, even if I rebuild the project multiple times.

AndroidStudio-test.zip (3.1 MB)
Fire-test.zip (947.3 KB)

Update - the 197 compiling hints are related to Google Play Services dependencies, not excluded com.android.support dependency.

Hmm, ok. I’ll have a look at the projects tomorrow. you probably need the full name(s) in the exclude, with : and the second part of the name; checking the code, I compare full package names, not prefixes, for the excludes (right now; I’ll probably expand that)

Hmm. someone was supposed to follow up on that, sorry. this failure is outride of my scope, this seems to be compiler or debug engine related. I’ll chase this up with the team tomorrow.

hi, do you notice anything before the working application stops working? Like a specfic thing that happens before this occurs?

As for not the testcase that’s not working at all: Your test app uses com.android. as a namespace, but that’s a reserved namespace that we ignore for debugging (that’s the namespace android itself uses), to avoid breakpoints in the runtime.

Hi Carlo

Sorry for late reply I was on a trip yesterday. I compiled a new sample for you, without the forbidden namespace in project name but also without excluding com.android.suport dependency for Google Play Services reference because I have no idea how to do it right. This should somehow be excluded from Fire Project to make it work, as you can see from the working Android Studio project attached three posts above.

New Fire ProviderInstaller test.zip (396.9 KB)

This is what happens before ProviderInstaller.InstallIfNeeded is called:

This is what happens when the ProviderInstaller line is executed:

Please note that breakpoints sometimes work and sometimes they don’t. I guess I was lucky this time. :wink:

Any update on this?

not yet; I’ll ping my colleague again.

Thank you.

We’ve managed to reproduce the debugging problem and are looking into that. I’m not sure about the exception itself though, I have never used that api.

As I said, for ProviderInstaller.InstallIfNeeded to work it has to be possible to exclude com.android.support dependency for Google Play Services. The Android Studio project (attached to one of my previous emails) build.gradle dependencies look like this:

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation('com.google.android.gms:play-services-base:16.0.1') {
        exclude group: 'com.android.support'
    }
    implementation('com.google.android.gms:play-services-basement:16.1.0') {
        exclude group: 'com.android.support'
    }
    implementation project(':com.straightsync.android.library')
    implementation project(':cooper')
    implementation project(':swift')
}

As you can see, I’m excluding com.android.support dependency from com.google.android.gms:play-services-base and com.google.android.gms:play-services-basement. AFAIK this can’t be done in Fire so ProviderInstaller fails.

Given that I can’t compile my project in Fire I just compile the shared code into Android Library and do the rest in Android Studio. Which is too bad because I would prefer to use Fire for everything. But I’m not a paying customer at the moment so I know I can’t expect you to loose much time solving this problem. I hope you’ll be able to do it sometime. Until then, I can live with Android Studio.

Your project has

<ExcludeGradleDependency Include="com.android.support" />

you want

<ExcludeGradleDependency Include="com.android.support:whatever" />

where whatever is the name of the actual package you want excluded (eg "appcompatibility-v7` or whatever the offending package may be.

For vNext I’ve made it so that com.android.support will work and exclude com.android.support:*.

wherewhateveris the name of the actual package you want excluded (eg "appcompatibility-v7 or whatever the offending package may be.`

I’ll give it a try. Do I also have to specify a version of excluded dependency under :whatever?

no, just namespace:name

From what I could figure out from Fire’s references and hints, appcompat-v7 and support-v4 are the problem (see screenshot). Then again, maybe not, maybe I got it all wrong. Anyway, manually adding <ExcludeGradleDependency Include="com.android.support:appcompat-v7" /> and <ExcludeGradleDependency Include="com.android.support:support-v4" /> with or without version numbers or asterisks (*) didn’t change anything. I thought of adding all com.android.support libraries but there are just too many of them. I’m afraid only you guys (Marc & Co.) can figure this out. I’m back to Android Studio for app and Fire for shared libs combination. :frowning:

Let me send you a new build where the exclude for the whole namespace (ie <ExcludeGradleDependency Include="com.android.support" />) will work.

Up on Personal downloads; check https://docs.elementscompiler.com/Fire/Setup/Mac/ExternalCompiler/ for instructions on how to set up the External compiler, if needed. Make sure to do a rebuild the first time, just in case. You should see several messages Excluding Gradle dependency '{0}' from package '{1}'.

(if you don’t, the exclude isn’t working. if you do, and it still fails,. then the problem is something else altogether…)