How to fix Application Default Credentials IOException issue in Android Studio
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm trying to use the Dialogflow v2 beta Java API in Android Studio, however, I'm getting an IOException stating that the Application Default Credentials are not available.
I've downloaded the service account keys with the credentials for accessing Dialogflow and have set the GOOGLE_APPLICATION_CREDENTIALS environmental variable from within the command prompt, in the control panel system settings, and from within the terminal window inside Android Studio. In the terminal (both inside and outside Android Studio), printing the GOOGLE_APPLICATION_CREDENTIALS displays the correct json file I set it to, however, when I use
System.getenv("GOOGLE_APPLICATION_CREDENTIALS")
in my Java code, it returns null. If it is this that's causing my issue, how do I provide Java with the correct value?
I've tried restarting both my computer and Android Studio after setting the environmental variable. I've also tried starting Android Studio from the command prompt with the variable set.
The code I'm running is the sample code found here.
Here are my dependencies. I've tried updating them to all the latest versions but it seems to create incompatibility errors. I'm reluctant to spend too much time trying to solve these incompatibility errors if the problem is due to something else.
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'de.hdodenhof:circleimageview:1.3.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
// Google
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
// Firebase
implementation 'com.google.firebase:firebase-analytics:15.0.2'
implementation 'com.google.firebase:firebase-database:15.0.1'
implementation 'com.google.firebase:firebase-storage:15.0.2'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.firebase:firebase-config:15.0.2'
implementation 'com.google.android.gms:play-services-appinvite:15.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-appindexing:15.0.1'
implementation 'com.google.firebase:firebase-analytics:15.0.2'
implementation 'com.google.firebase:firebase-firestore:15.0.0'
implementation 'com.google.firebase:firebase-functions:15.0.0'
// version 17 is not compatible with FirebaseUI 3.3.1
implementation 'com.google.firebase:firebase-messaging:15.0.0'
// Dialogflow
implementation 'com.google.cloud:google-cloud-dialogflow:0.74.0-alpha'
implementation 'io.grpc:grpc-okhttp:1.16.1'
implementation 'ai.api:sdk:2.0.7@aar'
implementation 'ai.api:libai:1.6.12'
// Firebase UI
implementation "com.firebaseui:firebase-ui-firestore:3.3.1"
//Crashlytics
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
// Testing dependencies
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
Let me know if there's any other information that might be useful. I'm running Android Studio 3.2.1 on Windows 10.
add a comment |
I'm trying to use the Dialogflow v2 beta Java API in Android Studio, however, I'm getting an IOException stating that the Application Default Credentials are not available.
I've downloaded the service account keys with the credentials for accessing Dialogflow and have set the GOOGLE_APPLICATION_CREDENTIALS environmental variable from within the command prompt, in the control panel system settings, and from within the terminal window inside Android Studio. In the terminal (both inside and outside Android Studio), printing the GOOGLE_APPLICATION_CREDENTIALS displays the correct json file I set it to, however, when I use
System.getenv("GOOGLE_APPLICATION_CREDENTIALS")
in my Java code, it returns null. If it is this that's causing my issue, how do I provide Java with the correct value?
I've tried restarting both my computer and Android Studio after setting the environmental variable. I've also tried starting Android Studio from the command prompt with the variable set.
The code I'm running is the sample code found here.
Here are my dependencies. I've tried updating them to all the latest versions but it seems to create incompatibility errors. I'm reluctant to spend too much time trying to solve these incompatibility errors if the problem is due to something else.
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'de.hdodenhof:circleimageview:1.3.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
// Google
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
// Firebase
implementation 'com.google.firebase:firebase-analytics:15.0.2'
implementation 'com.google.firebase:firebase-database:15.0.1'
implementation 'com.google.firebase:firebase-storage:15.0.2'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.firebase:firebase-config:15.0.2'
implementation 'com.google.android.gms:play-services-appinvite:15.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-appindexing:15.0.1'
implementation 'com.google.firebase:firebase-analytics:15.0.2'
implementation 'com.google.firebase:firebase-firestore:15.0.0'
implementation 'com.google.firebase:firebase-functions:15.0.0'
// version 17 is not compatible with FirebaseUI 3.3.1
implementation 'com.google.firebase:firebase-messaging:15.0.0'
// Dialogflow
implementation 'com.google.cloud:google-cloud-dialogflow:0.74.0-alpha'
implementation 'io.grpc:grpc-okhttp:1.16.1'
implementation 'ai.api:sdk:2.0.7@aar'
implementation 'ai.api:libai:1.6.12'
// Firebase UI
implementation "com.firebaseui:firebase-ui-firestore:3.3.1"
//Crashlytics
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
// Testing dependencies
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
Let me know if there's any other information that might be useful. I'm running Android Studio 3.2.1 on Windows 10.
add a comment |
I'm trying to use the Dialogflow v2 beta Java API in Android Studio, however, I'm getting an IOException stating that the Application Default Credentials are not available.
I've downloaded the service account keys with the credentials for accessing Dialogflow and have set the GOOGLE_APPLICATION_CREDENTIALS environmental variable from within the command prompt, in the control panel system settings, and from within the terminal window inside Android Studio. In the terminal (both inside and outside Android Studio), printing the GOOGLE_APPLICATION_CREDENTIALS displays the correct json file I set it to, however, when I use
System.getenv("GOOGLE_APPLICATION_CREDENTIALS")
in my Java code, it returns null. If it is this that's causing my issue, how do I provide Java with the correct value?
I've tried restarting both my computer and Android Studio after setting the environmental variable. I've also tried starting Android Studio from the command prompt with the variable set.
The code I'm running is the sample code found here.
Here are my dependencies. I've tried updating them to all the latest versions but it seems to create incompatibility errors. I'm reluctant to spend too much time trying to solve these incompatibility errors if the problem is due to something else.
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'de.hdodenhof:circleimageview:1.3.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
// Google
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
// Firebase
implementation 'com.google.firebase:firebase-analytics:15.0.2'
implementation 'com.google.firebase:firebase-database:15.0.1'
implementation 'com.google.firebase:firebase-storage:15.0.2'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.firebase:firebase-config:15.0.2'
implementation 'com.google.android.gms:play-services-appinvite:15.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-appindexing:15.0.1'
implementation 'com.google.firebase:firebase-analytics:15.0.2'
implementation 'com.google.firebase:firebase-firestore:15.0.0'
implementation 'com.google.firebase:firebase-functions:15.0.0'
// version 17 is not compatible with FirebaseUI 3.3.1
implementation 'com.google.firebase:firebase-messaging:15.0.0'
// Dialogflow
implementation 'com.google.cloud:google-cloud-dialogflow:0.74.0-alpha'
implementation 'io.grpc:grpc-okhttp:1.16.1'
implementation 'ai.api:sdk:2.0.7@aar'
implementation 'ai.api:libai:1.6.12'
// Firebase UI
implementation "com.firebaseui:firebase-ui-firestore:3.3.1"
//Crashlytics
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
// Testing dependencies
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
Let me know if there's any other information that might be useful. I'm running Android Studio 3.2.1 on Windows 10.
I'm trying to use the Dialogflow v2 beta Java API in Android Studio, however, I'm getting an IOException stating that the Application Default Credentials are not available.
I've downloaded the service account keys with the credentials for accessing Dialogflow and have set the GOOGLE_APPLICATION_CREDENTIALS environmental variable from within the command prompt, in the control panel system settings, and from within the terminal window inside Android Studio. In the terminal (both inside and outside Android Studio), printing the GOOGLE_APPLICATION_CREDENTIALS displays the correct json file I set it to, however, when I use
System.getenv("GOOGLE_APPLICATION_CREDENTIALS")
in my Java code, it returns null. If it is this that's causing my issue, how do I provide Java with the correct value?
I've tried restarting both my computer and Android Studio after setting the environmental variable. I've also tried starting Android Studio from the command prompt with the variable set.
The code I'm running is the sample code found here.
Here are my dependencies. I've tried updating them to all the latest versions but it seems to create incompatibility errors. I'm reluctant to spend too much time trying to solve these incompatibility errors if the problem is due to something else.
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'de.hdodenhof:circleimageview:1.3.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
// Google
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
// Firebase
implementation 'com.google.firebase:firebase-analytics:15.0.2'
implementation 'com.google.firebase:firebase-database:15.0.1'
implementation 'com.google.firebase:firebase-storage:15.0.2'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.firebase:firebase-config:15.0.2'
implementation 'com.google.android.gms:play-services-appinvite:15.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-appindexing:15.0.1'
implementation 'com.google.firebase:firebase-analytics:15.0.2'
implementation 'com.google.firebase:firebase-firestore:15.0.0'
implementation 'com.google.firebase:firebase-functions:15.0.0'
// version 17 is not compatible with FirebaseUI 3.3.1
implementation 'com.google.firebase:firebase-messaging:15.0.0'
// Dialogflow
implementation 'com.google.cloud:google-cloud-dialogflow:0.74.0-alpha'
implementation 'io.grpc:grpc-okhttp:1.16.1'
implementation 'ai.api:sdk:2.0.7@aar'
implementation 'ai.api:libai:1.6.12'
// Firebase UI
implementation "com.firebaseui:firebase-ui-firestore:3.3.1"
//Crashlytics
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
// Testing dependencies
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
Let me know if there's any other information that might be useful. I'm running Android Studio 3.2.1 on Windows 10.
asked Jan 4 at 14:32
kw3rtikw3rti
4518
4518
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54040922%2fhow-to-fix-application-default-credentials-ioexception-issue-in-android-studio%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54040922%2fhow-to-fix-application-default-credentials-ioexception-issue-in-android-studio%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown