floatinghotpot / cordova-plugin-facebookads

Cordova/PhoneGap plugin for Facebook Audience Network Ads
65 stars 71 forks source link

Always show "error: 1203, reason: Fatal" #52

Closed prinzekero closed 7 years ago

prinzekero commented 7 years ago

This error was happen for a while with unknow reason. It never happen before, everything was fine when I just simply create banner.

Now, every time I created new Phonegap app with your plugin, follow the same steps. Facebook ads never show even in testing mode.

Image

jonas-m- commented 7 years ago

Have anyone been able to resolve this?

floatinghotpot commented 7 years ago

From Facebook Audience Network docs, we could not find the meaning of error code 1203. https://developers.facebook.com/docs/audience-network/testing

Only following error codes listed: 1000 - Network Error 1001 - No Fill 1002 - Ad Load Too Frequently 2000 - Server Error 2001 - Internal Error

I will try updating the AudNet SDK to newest version, and see whether it happens again.

prinzekero commented 7 years ago

Any good news for this?

mrakowski0 commented 7 years ago

I have the same issue. It used to work around 2 months ago.

jonas-m- commented 7 years ago

Did manage to find a solution - an update of FB audience network SDK was needed. See here: https://github.com/floatinghotpot/cordova-plugin-facebookads/pull/53

mrakowski0 commented 7 years ago

@jonas-m- nice one, I will take a look. Thanks for linking the PR 👍

prinzekero commented 7 years ago

@jonas-m- Can I edit this fixed in my local project "plugin.xml" directly? I use Phonegap/Cordova CLI.

jonas-m- commented 7 years ago

@princekero Until the fix is merged, you may use my fixed version of this plugin, as such:

<plugin name="cordova-plugin-facebookads" spec="https://github.com/jonas-m-/cordova-plugin-facebookads.git" />

Use with caution though - I haven't tested the iOS part, though for Android - should work fine :)

prinzekero commented 7 years ago

@jonas-m- I try your code, it's work when isTesting: true. But not work when I turn it false. It show error:-1, reason: unknown error instead. :'(

jonas-m- commented 7 years ago

@princekero This might be related to your Facebook audience network setup, because it works for me, when I:

anmolagar commented 7 years ago

Hi @mrakowski0, any ETA on this one?

mrakowski0 commented 7 years ago

@anmolagar I'm not the maintainer. @floatinghotpot has to take a look.

hodaifa82 commented 7 years ago

same error

SidMehta commented 7 years ago

@jonas-m- Thanks for the fix Jonas. Though, while building using Phonegap Build service, the plugin fails the build.

Logs: Build Date: 2017-04-19 15:18:33 +0000 Configuration on demand is an incubating feature. Incremental java compilation is an incubating feature. Download https://repo1.maven.org/maven2/com/facebook/android/audience-network-sdk/4.21.1/audience-network-sdk-4.21.1.pom Download https://jcenter.bintray.com/com/google/android/exoplayer/exoplayer/r2.0.3/exoplayer-r2.0.3.pom Download https://jcenter.bintray.com/com/google/android/exoplayer/exoplayer/r2.0.3/exoplayer-r2.0.3.aar Download https://repo1.maven.org/maven2/com/facebook/android/audience-network-sdk/4.21.1/audience-network-sdk-4.21.1.aar :preBuild UP-TO-DATE :preReleaseBuild UP-TO-DATE :checkReleaseManifest :preDebugBuild UP-TO-DATE :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugNdk UP-TO-DATE :CordovaLib:compileLint :CordovaLib:copyDebugLint UP-TO-DATE :CordovaLib:mergeDebugProguardFiles :CordovaLib:packageDebugRenderscript UP-TO-DATE :CordovaLib:checkDebugManifest :CordovaLib:prepareDebugDependencies :CordovaLib:compileDebugRenderscript :CordovaLib:generateDebugResValues :CordovaLib:generateDebugResources :CordovaLib:packageDebugResources :CordovaLib:compileDebugAidl :CordovaLib:generateDebugBuildConfig :CordovaLib:mergeDebugShaders :CordovaLib:compileDebugShaders :CordovaLib:generateDebugAssets :CordovaLib:mergeDebugAssets :CordovaLib:processDebugManifest :CordovaLib:processDebugResources :CordovaLib:generateDebugSources :CordovaLib:incrementalDebugJavaCompilationSafeguard :CordovaLib:compileDebugJavaWithJavac :CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. :CordovaLib:processDebugJavaRes UP-TO-DATE :CordovaLib:transformResourcesWithMergeJavaResForDebug :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug :CordovaLib:mergeDebugJniLibFolders :CordovaLib:transformNative_libsWithMergeJniLibsForDebug :CordovaLib:transformNative_libsWithSyncJniLibsForDebug :CordovaLib:bundleDebug :CordovaLib:preReleaseBuild UP-TO-DATE :CordovaLib:compileReleaseNdk UP-TO-DATE :CordovaLib:copyReleaseLint UP-TO-DATE :CordovaLib:mergeReleaseProguardFiles :CordovaLib:packageReleaseRenderscript UP-TO-DATE :CordovaLib:checkReleaseManifest :CordovaLib:prepareReleaseDependencies :CordovaLib:compileReleaseRenderscript :CordovaLib:generateReleaseResValues :CordovaLib:generateReleaseResources :CordovaLib:packageReleaseResources :CordovaLib:compileReleaseAidl :CordovaLib:generateReleaseBuildConfig :CordovaLib:mergeReleaseShaders :CordovaLib:compileReleaseShaders :CordovaLib:generateReleaseAssets :CordovaLib:mergeReleaseAssets :CordovaLib:processReleaseManifest :CordovaLib:processReleaseResources :CordovaLib:generateReleaseSources :CordovaLib:incrementalReleaseJavaCompilationSafeguard :CordovaLib:compileReleaseJavaWithJavac :CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. :CordovaLib:processReleaseJavaRes UP-TO-DATE :CordovaLib:transformResourcesWithMergeJavaResForRelease :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease :CordovaLib:mergeReleaseJniLibFolders :CordovaLib:transformNative_libsWithMergeJniLibsForRelease :CordovaLib:transformNative_libsWithSyncJniLibsForRelease :CordovaLib:bundleRelease :prepareComAndroidSupportAnimatedVectorDrawable2500Library :prepareComAndroidSupportAppcompatV72500Library :prepareComAndroidSupportRecyclerviewV72500Library :prepareComAndroidSupportSupportCompat2500Library :prepareComAndroidSupportSupportCoreUi2500Library :prepareComAndroidSupportSupportV132340Library :prepareComAndroidSupportSupportV42340Library :prepareComAndroidSupportSupportVectorDrawable2500Library :prepareComFacebookAndroidAudienceNetworkSdk4211Library :prepareComGoogleAndroidExoplayerExoplayerR203Library :prepareComGoogleAndroidGmsPlayServicesAds1020Library :prepareComGoogleAndroidGmsPlayServicesAdsLite1020Library :prepareComGoogleAndroidGmsPlayServicesAnalytics1020Library :prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl1020Library :prepareComGoogleAndroidGmsPlayServicesBase1020Library :prepareComGoogleAndroidGmsPlayServicesBasement1020Library :prepareComGoogleAndroidGmsPlayServicesClearcut1020Library :prepareComGoogleAndroidGmsPlayServicesGass1020Library :prepareComGoogleAndroidGmsPlayServicesGcm1020Library :prepareComGoogleAndroidGmsPlayServicesIid1020Library :prepareComGoogleAndroidGmsPlayServicesTagmanagerV4Impl1020Library :prepareComGoogleAndroidGmsPlayServicesTasks1020Library :prepareProjectCordovaLibUnspecifiedReleaseLibrary :prepareReleaseDependencies :compileReleaseAidl :compileReleaseRenderscript :generateReleaseBuildConfig :mergeReleaseShaders :compileReleaseShaders :generateReleaseAssets :mergeReleaseAssets :generateReleaseResValues :generateReleaseResources :mergeReleaseResources :processReleaseManifest :processReleaseResources :generateReleaseSources :incrementalReleaseJavaCompilationSafeguard :compileReleaseJavaWithJavac :compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. :compileReleaseNdk UP-TO-DATE :compileReleaseSources :prePackageMarkerForRelease :transformClassesWithDexForRelease FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 18.756 secs Error: /project/gradlew: Command failed with exit code 1 Error output: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

Can you help out? Plus is there a previous version number of this plugin that you know, that might work? Till the time it is fixed.

jonas-m- commented 7 years ago

@SidMehta Can you try removing line <framework src="com.android.support:support-v4:+" /> from plugins/cordova-plugin-facebookads/plugin.xml ?

SidMehta commented 7 years ago

@jonas-m- Actually I am using the build.phonegap.com to build the app for android. So I can only get the plugin from the repository.

jonas-m- commented 7 years ago

@SidMehta And after that.. rebuild your platform, like so: cordova platform remove android && cordova platform add android

jonas-m- commented 7 years ago

@SidMehta Then you might try forking my repo and modifying it, if that's not too much of a hassle :) I haven't yet dug into the plugin that deep, but the support v4 lib seems un-needed, though the author should confirm that first

SidMehta commented 7 years ago

Sure @jonas-m- :) Let me try and get back if I am able to get it to work using the build service :)

prinzekero commented 7 years ago

@jonas-m- I knew it. That because facebook not serve ads for my fb account anymore (btw I'm a owner of those app). Then I try with another person account for received pre-approved ads, also need to add this person as developer. Your fixed just work great for now!

@SidMehta Oh, I found this problem too but in another error message. It only happen on another person PC, not mine. PG

jonas-m- commented 7 years ago

@princekero This error you posted is caused by the new version of FB AudNet com.facebook.android:audience-network-sdk:4.22.+. I've already fixed this in my repo, you can re-download the plugin

SidMehta commented 7 years ago

@jonas-m- Getting the same error after removing <framework src="com.android.support:support-v4:+" />

prinzekero commented 7 years ago

@SidMehta I solved my error, just done what @jonas-m- posted. I have these lines... <framework src="com.android.support:support-v4:+" /> <framework src="com.google.android.gms:play-services-ads:+"/> <framework src="com.facebook.android:audience-network-sdk:4.21.+"/>

SidMehta commented 7 years ago

Thanks @princekero . I am also now able to build the app. But for me, onAdLoaded event just doesn't trigger. Neither does the onAdFailLoad event triggers. Are you able to see the ads?

SidMehta commented 7 years ago

Got it to work :) Thanks a lot @jonas-m- @princekero @floatinghotpot :) You guys rock!

hodaifa82 commented 7 years ago

i cant solve this issue can you tell me where exactly you add these lines , plugin.xml inside facebookads plugin folder???? what else i have to change ??? can you make it easy clear steps because im very confused?

prinzekero commented 7 years ago

@hodaifa82 in config.xml find your original plugin line which should be <plugin name="cordova-plugin-facebookads" spec="4.7.4" right?

You need to change this line to <plugin name="cordova-plugin-facebookads" spec="https://github.com/jonas-m-/cordova-plugin-facebookads.git" /> You also need to install git program (e.g. https://git-for-windows.github.io if you work on windows) to be able direct download from github. Then clear all the platform, plugin folder and add platform/build again. Done!

hodaifa82 commented 7 years ago

what i did because im using intelxdk insted downloading from cordova-plugin-facebookads i download from https://github.com/jonas-m-/cordova-plugin-facebookads.git and the plugin added correctly im able to see the new 3lines , but the link didnt download the audience network pulug in but the and build failed ??? im having this message Required by: :android:unspecified > com.facebook.android:audience-network-sdk:4.21.1

hodaifa82 commented 7 years ago

@jonas-m-
framework src="com.facebook.android:audience-network-sdk:4.21.+" this line makes build fails ???? any suggesions?

jonas-m- commented 7 years ago

@hodaifa82 Can you please post the full build log somewhere and paste a link in here?

hodaifa82 commented 7 years ago

https://am-xdk2.s3.amazonaws.com/cust.3cca3daf-b205-49ab-b8da-0ca9775ef310/app.23c5a9f9-454f-478d-86f6-8dbfc66de682/android/fbfinal.build.201704203308.txt?X-Amz-Expires=86400&x-amz-security-token=FQoDYXdzEHIaDIBGiHGbnOSBTu%2BYWiKcAySiH2Mt249POnSU%2BZ3XjVIoxKpcMv77eKvSawcCilubI2tgxqM7RxqgPx9bZgAr4deQItjj8FlanQLqZ1AP5OWgE84DaZ53YLg0BiZwbBkzkdNjfC32JWt0LfYt68F284o53wVTio9TPjYYQugMyLEwH3uXyTvLzTvFBTm6glTOb%2BSK4wfAxWygdkRlLx2ShMTBOtmK7yiDZga72bpqIX%2FGFSE5sIqZRp496S6EjEI9orXQimT255PA1MonFQSzNxJcmvqK0Bq7f10UhpjxGIATG784slA5A%2Bbw6XNyeOtjbWYuQZWbvwC5A0cbX7FID8sSAIGOik0waKcEbfVZBevG4iOh0CY4SAdFZBtYkyIRxAJtV9ZgQkkxCFh%2Bzo6ONWqHbYfpCTuFAk40bfWk3J4%2B5jKrGiAzOm6KhfKauIdu%2F6uxWWi3AUxIcWFtgO4OEoRbMIKq8QwVQ%2FDQY7QsZCw%2Fadays6FKQD6I7fHniTKSYpWAje7Bk79PCre%2FNSkrnrLDJCbQwXG3SpimaeNdsVjmzEpfoxzhRBOFqMoo3ubhxwU%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAJENDTTMGX3LDJFCQ/20170420/us-east-1/s3/aws4_request&X-Amz-Date=20170420T093345Z&X-Amz-SignedHeaders=host;x-amz-security-token&X-Amz-Signature=994714567ca50b7aadac9407a0c86fc6a7ea8684186e0128f3e7428c33df729f

jonas-m- commented 7 years ago

@hodaifa82 Looks like you are missing the jcenter repository. Your platforms/android/build.gradle file should contain:

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
   ...
}

jcenter is added by default since newer versions of cordova, so you might consider updating cordova & cordova Android platform

hodaifa82 commented 7 years ago

ah ok thanks i will try to do it

hodaifa82 commented 7 years ago

im using version 6.2

hodaifa82 commented 7 years ago

screen shot 2017-04-20 at 1 01 56 pm @jonas-m- may be the problem is the config,xml file is giving the same old line even after downloading your plugin???????plugin name="cordova-plugin-facebookads" spec="4.7.4" do you suggest to change it ?

mrakowski0 commented 7 years ago

@jonas-m-

Hey, thanks for the effort. It started to work for Android but now the build fails for iOS

/src/platforms/ios/XYZ/Plugins/cordova-plugin-facebookads/FacebookAdPlugin.m:9:9: fatal error: 'FBAudienceNetwork/FBAudienceNetwork.h' file not found
#import <FBAudienceNetwork/FBAudienceNetwork.h>
        ^
1 error generated.

Any ideas how to fix it?

jonas-m- commented 7 years ago

@mrakowski0 What are you using to build iOS? Because it seems that the FBAudienceNetwork pod wasn't downloaded from CocoaPods

mrakowski0 commented 7 years ago

@jonas-m- I'm using ionic/cordova. If I use the plugin from this repository then the build just works for both platforms, if I use your fork then Android fatal error is fixed but iOS build fails.

jonas-m- commented 7 years ago
jonas-m- commented 7 years ago

Also, make sure your Cordova iOS platform version is >= 4.3.0, because CocoaPods support was introduced in 4.3. Like so:

$ cordova platform list
Installed platforms:
  android 6.1.2
  ios 4.3.1
hodaifa82 commented 7 years ago

@princekero regarding to deviceHash: 'copy_your_hash_id_from_console_here' can i use the default on the code given or i have to put my own ? how to get testing one?

prinzekero commented 7 years ago

@hodaifa82 I can use testing:true mode on any mobile phone. I didn't see any point to use hash_id for the test. You can received real test ads with testing:false by the way.

anmolagar commented 7 years ago

ok, this works now if actual plugin is changed with this: <plugin name="cordova-plugin-facebookads" spec="https://github.com/jonas-m-/cordova-plugin-facebookads.git" />

But now there is new problem with native ads. I am seeing a top left green box no matter where i place my ad. I have even added something like this FacebookAds.setNativeAdClickArea('209755156184604_209757376184382', 10, 100, 251, 90); but nothing works.

Any idea anyone? what is missing?

hodaifa82 commented 7 years ago

im trying more than 2 weeks after i install @jonas-m- update the error message disappears but no actions im not receiving any ads ?????!!!!!!

jonas-m- commented 7 years ago

@hodaifa82 What is the FB error code & message you are getting for not serving the ad? I had problems with 2000 Server Error on iOS, which.. resolved by itself somehow..

And also got 1001 No Fill when testing on a real Android device. The solution: deploy a signed, release version of the app to an emulator with FB test mode disabled (serving real ads). That did the trick - the ad was displayed: I was able to get ad request & apply for approval

hodaifa82 commented 7 years ago

@jonas-m- im using test mode on real android device no hash key no thing just the code given in test app , im testing on real device does the problem because im using test mode not real data?

i have no error messages , just no ad showing after click

SidMehta commented 7 years ago

Hi @jonas-m- . Your fork builds well and shows the ads correctly, but for one issue. The clickable area is not updating and just a small top left corner of the app is clickable. I think the issue is same as it's faced by @anmolagar . Do you know what or where the issue can be? Thanks :)

jonas-m- commented 7 years ago

@SidMehta Well.. my fork only updated the facebook audience SDK dependency & made use of Gradle (and CocoaPods, on iOS) dependency management features available in newer cordova platform version.

So my guess would be that the problem lies in the native code of this plugin, which handles native ad positioning. For that, you could launch your from from within Android Studio (if you're having problems with Android platform), look for clues in logcat. If nothing's there - try to debug the issue, place a few breakpoints in the code of the plugin (FacebookAdPlugin.java) to see how it behaves & where it breaks down - perhaps the native code needs to be updated against the updated FbAudNet SDK

hodaifa82 commented 7 years ago

@SidMehta @princekero @jonas-m- what cordova version you used? 6.2 5,4 6.5???????????????????

SidMehta commented 7 years ago

@hodaifa82 PhoneGap cli-6.5.0