2

When importing Android project into VCS (Google Cloud source repositories), I'm able to select the cloud project, but getting following error for viewing repositories:

enter image description here

I'm following this doc to import project: https://cloud.google.com/tools/android-studio/vcs.

Project level build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Sam
  • 822
  • 2
  • 8
  • 30
  • Please share your project-level `build.gradle file. And also, just make sure the internet connection is okay as well. – Reaz Murshed Oct 03 '19 at 15:26
  • @ReazMurshed, updated please check. I'm getting this error for other projects as well. Could it be permission issue? – Sam Oct 03 '19 at 15:29

2 Answers2

0

I can see three possible causes:

  1. A permissions issue, please remember to set up authentication properly with one of the three methods here.

  2. A mix-up between the Project Name and the Project ID (use the Project ID only) on Android Studio's dialog box.

  3. Not having set up the "default" repository on the GCP project. To create a repository on your Google Cloud Project follow this instructions and name your repository default.

Daniel Ocando
  • 3,554
  • 2
  • 11
  • 19
0

My solution which is less than ideal is to fall back to using git via https. The steps for setting this up are provided in the GCP source repository under clone -> manually generated credentials (basically you run a cmd or bash script to store a git cookie).

David B
  • 1
  • 1