Skip to content

Could not find method google() #1673

Open
@Timmmm

Description

@Timmmm

Steps to Reproduce

Just make a new project and then add the shared_preferences plugin as described in its instructions.

I get this error when building:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/shot/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.3.1/android/build.gradle' line: 6

* What went wrong:
A problem occurred evaluating project ':shared_preferences'.
> Could not find method google() for arguments [] on repository container.

To be honest... I'm not 100% sure the project is set up correctly. It pretty much only worked properly the first time I created it and then IntelliJ just forgot all the Android/Flutter settings and it hasn't really worked properly since. The module/SDK/etc. configuration stuff is not very robust at all.

In fact, I removed the references to shared_preferences from my code and from the yaml file, and I still get the same error. That is very weird. Is there no way to do something like a make clean?

Version info

[✓] Flutter (on Mac OS X 10.13.2 17C88, locale en-GB, channel alpha)
    • Flutter at /Users/shot/Tim/flutter
    • Framework revision 8f65fec5f5 (7 weeks ago), 2017-12-12 09:50:14 -0800
    • Engine revision edaecdc8b8
    • Tools Dart version 1.25.0-dev.11.0
    • Engine Dart version 2.0.0-edge.d8ae797298c3a6cf8dc9f4558707bd2672224d3e

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/shot/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[-] iOS toolchain - develop for iOS devices
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    ✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install:
        brew install ios-deploy
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
        For more info, see https://flutter.io/platform-plugins
      To install:
        brew install cocoapods
        pod setup

[✓] Android Studio (version 3.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] IntelliJ IDEA Community Edition (version 2017.3.3)
    • Flutter plugin version 21.1.3
    • Dart plugin version 173.4301.22

[✓] Connected devices
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions