How to use Google ADC in Android Studio?

( ADC : https://cloud.google.com/docs/authentication/provide-credentials-adc#how-to )

I want to use Application Default Credentials (ADC) in Android Studio,

No,1. I created a project in google cloud console.

No,2. I installed google CLI, and I entered the ‘gcloud auth application-default login
‘ command in the CLI.

No,3. The Google login window appears, so I’m logged in.
The project selection came up, so I chose the project I created in No,1.

No,4. JSON key was stored on my local computer.

No,5.In the environment variable setting, ‘GOOGLE_APPLICATION_CREDENTIALS’ – ‘JSON FILE LOCATION’ was set.

No,6. In Android Studio, run the code below. ( Kotlin )

@Throws(IOException::class)
fun test() {
    val routesSettings = RoutesSettings.newBuilder()
        .setHeaderProvider {
            val headers: MutableMap<String, String> =
                HashMap()
            headers["X-Goog-FieldMask"] = "*"
            headers
        }.build()
    val routesClient = RoutesClient.create(routesSettings)
    val response = routesClient.computeRoutes(
        ComputeRoutesRequest.newBuilder()
            .setOrigin(Waypoint.newBuilder().setPlaceId("ChIJeRp....").build())
            .setDestination(
                Waypoint.newBuilder().setPlaceId("ChIJG3kh....").build()
            )
            .setRoutingPreference(RoutingPreference.TRAFFIC_AWARE)
            .setTravelMode(RouteTravelMode.DRIVE).build()
    )
    println("Response: $response")
}

No,7. I encountered the following error.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.grpc_example/com.example.grpc_example.MainActivity}: java.io.IOException: Your default credentials were not found. To set up Application Default Credentials for your environment, see https://cloud.google.com/docs/authentication/external/set-up-adc.
                                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3782)
                                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922)
                                                                                                    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
                                                                                                    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
                                                                                                    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
                                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)
                                                                                                    at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                    at android.os.Looper.loop(Looper.java:294)
                                                                                                    at android.app.ActivityThread.main(ActivityThread.java:8177)
                                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
                                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
                                                                                                Caused by: java.io.IOException: Your default credentials were not found. To set up Application Default Credentials for your environment, see https://cloud.google.com/docs/authentication/external/set-up-adc.
                                                                                                    at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentials(DefaultCredentialsProvider.java:127)
                                                                                                    at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:152)
                                                                                                    at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:124)
                                                                                                    at com.google.api.gax.core.GoogleCredentialsProvider.getCredentials(GoogleCredentialsProvider.java:70)
                                                                                                    at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:162)
                                                                                                    at com.google.maps.routing.v2.stub.GrpcRoutesStub.create(GrpcRoutesStub.java:75)
                                                                                                    at com.google.maps.routing.v2.stub.RoutesStubSettings.createStub(RoutesStubSettings.java:112)
                                                                                                    at com.google.maps.routing.v2.RoutesClient.<init>(RoutesClient.java:211)
                                                                                                    at com.google.maps.routing.v2.RoutesClient.create(RoutesClient.java:194)
                                                                                                    at com.example.grpc_example.MainActivity.test(MainActivity.kt:52)
                                                                                                    at com.example.grpc_example.MainActivity.onCreate(MainActivity.kt:25)
                                                                                                    at android.app.Activity.performCreate(Activity.java:8595)
                                                                                                    at android.app.Activity.performCreate(Activity.java:8573)
                                                                                                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456)
                                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3764)

Q) Where did I set it up wrong?
Why won’t ADC certification work?

(The reason for using ADC authentication is to use the google route G-RPC function.)

Thank you.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật