Git Product home page Git Product logo

Comments (16)

goldierox avatar goldierox commented on May 23, 2024

Worth noting there's an Android Developer Tools bug open for this on their end. It's likely that you won't have to fix anything on your end.
https://code.google.com/p/android/issues/detail?id=66109

from android-maps-utils.

ndorigatti avatar ndorigatti commented on May 23, 2024

thanks for sharing it, hope it will be fixed in 0.4....

from android-maps-utils.

dbachelder avatar dbachelder commented on May 23, 2024

Have you found a workaround for this?

from android-maps-utils.

goldierox avatar goldierox commented on May 23, 2024

@dbachelder I added a little hack to my build script. Hope this helps
https://gist.github.com/goldierox/9533466

from android-maps-utils.

omarmiatello avatar omarmiatello commented on May 23, 2024

Pay attention, in Android Studio 0.5.1, with Gradle 0.9 I have different exploded build dir
That's my working build.gradle

apply plugin: 'android'

final BASE_PACKAGE_NAME = 'com.mycompany.appname.android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.2"
    final DEBUG_PROVIDER = "${BASE_PACKAGE_NAME}.provider.debug";

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        debug {
            buildConfigField "String", "AUTHORITY", "\"${DEBUG_PROVIDER}\""
        }
        release {
        }
    }

    applicationVariants.all{ variant ->
        // This is an annoying hack to get around the fact that the Gradle plugin does not support
        // having libraries with different minSdkVersions. Play Services has a min version of 9 (Gingerbread)
        // but Android Maps Utils supports 8 (Froyo) still
        variant.processManifest.doFirst {
            File manifestFile = file("${buildDir}/exploded-aar/com.google.maps.android/android-maps-utils/0.3/AndroidManifest.xml")
            if (manifestFile.exists()) {
                println("Replacing minSdkVersion in Android Maps Utils")
                String content = manifestFile.getText('UTF-8')
                content = content.replaceAll(/minSdkVersion="8"/, 'minSdkVersion=\"9\"')
                manifestFile.write(content, 'UTF-8')
                println(content)
            }
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services:4.2.42'
    compile 'com.android.support:support-v4:19.0.1'
    compile 'com.google.maps.android:android-maps-utils:0.3+'
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

from android-maps-utils.

clopeziiia avatar clopeziiia commented on May 23, 2024

Thanks guys, it worked!

from android-maps-utils.

dbachelder avatar dbachelder commented on May 23, 2024

@broady Just notice #75 then found this. do you have a snapshot build of the lib pushed somewhere so that we can remove our manifest munging hack? Thanks!

from android-maps-utils.

timusus avatar timusus commented on May 23, 2024

Any idea how one might use this workaround for a library project with such a dependency?

I've got a CastCompanionLibrary (for Chromecast) which depends on Google's Play-Services, which are also minSdk 9.

It looks like android-library modules don't support applicationVariants..

from android-maps-utils.

broady avatar broady commented on May 23, 2024

How come you still need the workaround? Use v0.3.1

from android-maps-utils.

timusus avatar timusus commented on May 23, 2024

Sorry, gradle noob here.

I don't understand what you mean by "Exclude the older transitive dependency", and I'm not exactly sure why I still need this workaround. Do you mean Gradle v0.3.1? I'll check what I'm using.

Edit: Clearly you don't mean Gradle v0.3.1, given I'm using v0.9.+. As for Play Services, I'm using v4.3.+

from android-maps-utils.

slavat avatar slavat commented on May 23, 2024

@timusus broady meaned to use android-maps-utils v0.3.1. It has the minSdkVersion conflict bug fixed.

from android-maps-utils.

timusus avatar timusus commented on May 23, 2024

Oh, my issue isn't with maps, but with Play Services.

Sorry, I should have guessed Broady was talking about maps.

from android-maps-utils.

broady avatar broady commented on May 23, 2024

I don't really understand, @timusus. What's your issue with Play Services?

from android-maps-utils.

timusus avatar timusus commented on May 23, 2024

@broady the exact same issue as with maps.

com.google.android.gms:play-services:4.3.+ uses minSdk 9, whereas I'm trying to support minSdk 8.

The app won't compile, for the same reason you struggled with maps 0.3.0. The thing is, I'm using a library project which depends on play-services, and I'm struggling to apply your workaround to that library.

from android-maps-utils.

broady avatar broady commented on May 23, 2024

Sorry, this library only supports minSdk 9.

You could try changing the dependency on play-services to 4.1.32, which was the last version that supported minSdk=8.

from android-maps-utils.

timusus avatar timusus commented on May 23, 2024

No, 4.3+ is required for other reasons.

It's OK, currently I'm just setting mindSdk = 9 and forgetting about older API's. I would've thought the same workaround you used with maps would work here - but because it's a library project, it doesn't.

I tried using libraryVariants and replacing the manifest's minSdk, but I can't seem to get it working.

Anyway, thanks for your help. I hit you up in hangouts if you had any other suggestions.

from android-maps-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.