How to get Google Cloud Tools for Android Studio l

2019-08-02 03:30发布

问题:

I am trying out the Google Cloud tools for Android Studio and cannot access the local server from any other devices on my network or locally via the machine's 192.169.etc address. It appears I need to set the server to listen on all IP addresses, not just localhost, which appears to be done by running with the command line argument --address=0.0.0.0. The problem is I cannot find where to do this in Android Studio at all. Can anyone help?

回答1:

OK I just worked it out (actually i re-read the documentation at https://github.com/GoogleCloudPlatform/gradle-appengine-plugin). Adding httpAddress="0.0.0.0" within the 'appengine' field in my build.gradle file sorted it. For reference, my build.gradle now includes:

appengine {
    downloadSdk = true
    appcfg {
        oauth2 = true
    }
    endpoints {
        getClientLibsOnBuild = true
        getDiscoveryDocsOnBuild = true
    }
    httpAddress="0.0.0.0"
}