Error: Program type already present: com.facebook.ads.Ad
I am trying to implement facebook sdk according to this,
https://developers.facebook.com/docs/audience-network/android
When I trying to compile it im getting this error.
Error: Program type already present: com.facebook.ads.Ad
I'm using android studio 3.2.1
this is my gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.test.test"
minSdkVersion 16
targetSdkVersion 27
multiDexEnabled true
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
implementation 'com.google.android.gms:play-services:+'
implementation 'com.android.support:multidex:1.0.3'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
implementation 'com.facebook.android:facebook-core:[4,5)'
implementation 'com.facebook.android:facebook-marketing:[4,5)'
implementation 'com.android.support:recyclerview-v7:25.3.1' // Required Dependency by Audience Network SDK
implementation 'com.facebook.android:audience-network-sdk:5.+'
// More deps here //
}
android facebook-android-sdk
|
show 4 more comments
I am trying to implement facebook sdk according to this,
https://developers.facebook.com/docs/audience-network/android
When I trying to compile it im getting this error.
Error: Program type already present: com.facebook.ads.Ad
I'm using android studio 3.2.1
this is my gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.test.test"
minSdkVersion 16
targetSdkVersion 27
multiDexEnabled true
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
implementation 'com.google.android.gms:play-services:+'
implementation 'com.android.support:multidex:1.0.3'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
implementation 'com.facebook.android:facebook-core:[4,5)'
implementation 'com.facebook.android:facebook-marketing:[4,5)'
implementation 'com.android.support:recyclerview-v7:25.3.1' // Required Dependency by Audience Network SDK
implementation 'com.facebook.android:audience-network-sdk:5.+'
// More deps here //
}
android facebook-android-sdk
1
Please post your app-levelbuild.gradle
.
– Jay
Nov 14 '18 at 8:37
Okay. done. I just added it
– Hi Im Naru7o
Nov 14 '18 at 8:41
Duplicate of stackoverflow.com/questions/49537914/…
– GoRo
Nov 14 '18 at 8:43
1
As you can see here -- the structure of facebook SDK, you have duplicate APIs since you're trying to use SDK and core together. Removeimplementation 'com.facebook.android:facebook-core:[4,5)'
and rebuild.
– Jay
Nov 14 '18 at 8:46
1
Thank you very much !
– Hi Im Naru7o
Nov 14 '18 at 8:59
|
show 4 more comments
I am trying to implement facebook sdk according to this,
https://developers.facebook.com/docs/audience-network/android
When I trying to compile it im getting this error.
Error: Program type already present: com.facebook.ads.Ad
I'm using android studio 3.2.1
this is my gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.test.test"
minSdkVersion 16
targetSdkVersion 27
multiDexEnabled true
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
implementation 'com.google.android.gms:play-services:+'
implementation 'com.android.support:multidex:1.0.3'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
implementation 'com.facebook.android:facebook-core:[4,5)'
implementation 'com.facebook.android:facebook-marketing:[4,5)'
implementation 'com.android.support:recyclerview-v7:25.3.1' // Required Dependency by Audience Network SDK
implementation 'com.facebook.android:audience-network-sdk:5.+'
// More deps here //
}
android facebook-android-sdk
I am trying to implement facebook sdk according to this,
https://developers.facebook.com/docs/audience-network/android
When I trying to compile it im getting this error.
Error: Program type already present: com.facebook.ads.Ad
I'm using android studio 3.2.1
this is my gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.test.test"
minSdkVersion 16
targetSdkVersion 27
multiDexEnabled true
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
implementation 'com.google.android.gms:play-services:+'
implementation 'com.android.support:multidex:1.0.3'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
implementation 'com.facebook.android:facebook-core:[4,5)'
implementation 'com.facebook.android:facebook-marketing:[4,5)'
implementation 'com.android.support:recyclerview-v7:25.3.1' // Required Dependency by Audience Network SDK
implementation 'com.facebook.android:audience-network-sdk:5.+'
// More deps here //
}
android facebook-android-sdk
android facebook-android-sdk
edited Nov 14 '18 at 8:45
Vadim Kotov
4,49863347
4,49863347
asked Nov 14 '18 at 8:36
Hi Im Naru7oHi Im Naru7o
479
479
1
Please post your app-levelbuild.gradle
.
– Jay
Nov 14 '18 at 8:37
Okay. done. I just added it
– Hi Im Naru7o
Nov 14 '18 at 8:41
Duplicate of stackoverflow.com/questions/49537914/…
– GoRo
Nov 14 '18 at 8:43
1
As you can see here -- the structure of facebook SDK, you have duplicate APIs since you're trying to use SDK and core together. Removeimplementation 'com.facebook.android:facebook-core:[4,5)'
and rebuild.
– Jay
Nov 14 '18 at 8:46
1
Thank you very much !
– Hi Im Naru7o
Nov 14 '18 at 8:59
|
show 4 more comments
1
Please post your app-levelbuild.gradle
.
– Jay
Nov 14 '18 at 8:37
Okay. done. I just added it
– Hi Im Naru7o
Nov 14 '18 at 8:41
Duplicate of stackoverflow.com/questions/49537914/…
– GoRo
Nov 14 '18 at 8:43
1
As you can see here -- the structure of facebook SDK, you have duplicate APIs since you're trying to use SDK and core together. Removeimplementation 'com.facebook.android:facebook-core:[4,5)'
and rebuild.
– Jay
Nov 14 '18 at 8:46
1
Thank you very much !
– Hi Im Naru7o
Nov 14 '18 at 8:59
1
1
Please post your app-level
build.gradle
.– Jay
Nov 14 '18 at 8:37
Please post your app-level
build.gradle
.– Jay
Nov 14 '18 at 8:37
Okay. done. I just added it
– Hi Im Naru7o
Nov 14 '18 at 8:41
Okay. done. I just added it
– Hi Im Naru7o
Nov 14 '18 at 8:41
Duplicate of stackoverflow.com/questions/49537914/…
– GoRo
Nov 14 '18 at 8:43
Duplicate of stackoverflow.com/questions/49537914/…
– GoRo
Nov 14 '18 at 8:43
1
1
As you can see here -- the structure of facebook SDK, you have duplicate APIs since you're trying to use SDK and core together. Remove
implementation 'com.facebook.android:facebook-core:[4,5)'
and rebuild.– Jay
Nov 14 '18 at 8:46
As you can see here -- the structure of facebook SDK, you have duplicate APIs since you're trying to use SDK and core together. Remove
implementation 'com.facebook.android:facebook-core:[4,5)'
and rebuild.– Jay
Nov 14 '18 at 8:46
1
1
Thank you very much !
– Hi Im Naru7o
Nov 14 '18 at 8:59
Thank you very much !
– Hi Im Naru7o
Nov 14 '18 at 8:59
|
show 4 more comments
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%2f53295957%2ferror-program-type-already-present-com-facebook-ads-ad%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%2f53295957%2ferror-program-type-already-present-com-facebook-ads-ad%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
1
Please post your app-level
build.gradle
.– Jay
Nov 14 '18 at 8:37
Okay. done. I just added it
– Hi Im Naru7o
Nov 14 '18 at 8:41
Duplicate of stackoverflow.com/questions/49537914/…
– GoRo
Nov 14 '18 at 8:43
1
As you can see here -- the structure of facebook SDK, you have duplicate APIs since you're trying to use SDK and core together. Remove
implementation 'com.facebook.android:facebook-core:[4,5)'
and rebuild.– Jay
Nov 14 '18 at 8:46
1
Thank you very much !
– Hi Im Naru7o
Nov 14 '18 at 8:59