cordova-plugin-facebookads
cordova-plugin-facebookads copied to clipboard
android build error, latest sdk error
hello, Phonegap can not build this plugin for android. Would you please update the latest sdk
same error for ionic
Same here
D:\cordova projects\Shortcutkeys\platforms\android\app\src\main\java\com\rjfun\c ordova\facebookads\FacebookAdPlugin.java:29: error: import requires canonical na me for Rating import com.facebook.ads.NativeAd.Rating; ^ D:\cordova projects\Shortcutkeys\platforms\android\app\src\main\java\com\rjfun\c ordova\facebookads\FacebookAdPlugin.java:212: error: incompatible types: <anonym ous AdListener> cannot be converted to NativeAdListener unit.ad.setAdListener(new AdListener(){ ^ D:\cordova projects\Shortcutkeys\platforms\android\app\src\main\java\com\rjfun\c ordova\facebookads\FacebookAdPlugin.java:249: error: cannot find symbol String titleForAd = unit.ad.getAdTitle() ; ^ symbol: method getAdTitle() location: variable ad of type NativeAd D:\cordova projects\Shortcutkeys\platforms\android\app\src\main\java\com\rjfun\c ordova\facebookads\FacebookAdPlugin.java:254: error: cannot find symbol String textForAdBody = unit.ad.getAdBody (); ^ symbol: method getAdBody() location: variable ad of type NativeAd D:\cordova projects\Shortcutkeys\platforms\android\app\src\main\java\com\rjfun\c ordova\facebookads\FacebookAdPlugin.java:275: error: cannot find symbol coverInfo.put("url", coverImage.getUrl()); ^ symbol: method getUrl() location: variable coverImage of type Image D:\cordova projects\Shortcutkeys\platforms\android\app\src\main\java\com\rjfun\c ordova\facebookads\FacebookAdPlugin.java:282: error: cannot find symbol iconInfo.put("url", iconForAd.getUrl()); ^ symbol: method getUrl() location: variable iconForAd of type Image D:\cordova projects\Shortcutkeys\platforms\android\app\src\main\java\com\rjfun\c ordova\facebookads\FacebookAdPlugin.java:296: error: no suitable method found fo r registerViewForInteraction(View) unit.ad.registerViewForInteraction(unit.tracking); ^ method NativeAd.registerViewForInteraction(View,MediaView) is not applicable
(actual and formal argument lists differ in length)
method NativeAd.registerViewForInteraction(View,MediaView,AdIconView) is not
applicable (actual and formal argument lists differ in length) method NativeAd.registerViewForInteraction(View,MediaView,List<View>) is not applicable (actual and formal argument lists differ in length) method NativeAd.registerViewForInteraction(View,MediaView,AdIconView,List<Vi ew>) is not applicable (actual and formal argument lists differ in length) method NativeAd.registerViewForInteraction(View,MediaView,ImageView) is not applicable (actual and formal argument lists differ in length) method NativeAd.registerViewForInteraction(View,MediaView,ImageView,List<Vie w>) is not applicable (actual and formal argument lists differ in length) Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 8 errors
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
-
Get more help at https://help.gradle.org
BUILD FAILED in 2s
D:\cordova projects\Shortcutkeys>
@floatinghotpot please update the latest sdk. we can not use this plugin. we can pay, if there is a pro version with the latest sdk
As I am only using banner ad, I found a work around. The above errors are relating to Native ads code and I commented all those imports and functions. Now it builds with the latest facebook sdk.
Also if you are showing banner with over lap, the getWidth() and getHeight() methods of adView are returning zero and hence the ads wont show up. I modified the code to getWidth() and getHeigh() methods of adSize and it works fine.
Try this https://github.com/merbin2012/cordova-plugin-codeplay-facebookads-free
@merbin2012 your plugin does not build
What went wrong: A problem occurred evaluating script.
Could not find method implementation() for arguments [com.android.support:recyclerview-v7:25.3.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler
@merbin2012 your plugin is working for banner, popup and rewarded video ad, but i want native, can you implement it?
I am facing the same issue in ionic 5 while building apk Does anyone found the solution for it ..Integrating Facebook ads with ionic 5 if found please comment on the solution...ASAP,
i'm using the plugin cordova-plugin-facebookads src is https://github.com/floatinghotpot/cordova-plugin-facebookads.git and i'm facing the issue of Task :app:compileDebugJavaWithJavac FAILED error: import requires canonical name for Image 1>MSBUILD : cordova-build error : import com.facebook.ads.NativeAd.Image; 1>MSBUILD : cordova-build error : ^ error: incompatible types: <anonymous AdListener> cannot be converted to NativeAdListener 1>MSBUILD : cordova-build error : unit.ad.setAdListener(new AdListener() 1>MSBUILD : cordova-build error : ^ error: cannot find symbol 1>MSBUILD : cordova-build error : String titleForAd = unit.ad.getAdTitle(); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: method getAdTitle() 1>MSBUILD : cordova-build error : location: variable ad of type NativeAd error: cannot find symbol 1>MSBUILD : cordova-build error : String textForAdBody = unit.ad.getAdBody(); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: method getAdBody() 1>MSBUILD : cordova-build error : location: variable ad of type NativeAd error: cannot find symbol 1>MSBUILD : cordova-build error : coverInfo.put("url", coverImage.getUrl()); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: method getUrl() 1>MSBUILD : cordova-build error : location: variable coverImage of type Image error: cannot find symbol 1>MSBUILD : cordova-build error : iconInfo.put("url", iconForAd.getUrl()); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : symbol: method getUrl() 1>MSBUILD : cordova-build error : location: variable iconForAd of type Image no suitable method found for registerViewForInteraction(View) 1>MSBUILD : cordova-build error : unit.ad.registerViewForInteraction(unit.tracking); 1>MSBUILD : cordova-build error : ^ 1>MSBUILD : cordova-build error : method NativeAd.registerViewForInteraction(View,MediaView) is not applicable 1>MSBUILD : cordova-build error : (actual and formal argument lists differ in length) 1>MSBUILD : cordova-build error : method NativeAd.registerViewForInteraction(View,MediaView,AdIconView) is not applicable 1>MSBUILD : cordova-build error : (actual and formal argument lists differ in length) 1>MSBUILD : cordova-build error : method NativeAd.registerViewForInteraction(View,MediaView,List<View>) is not applicable 1>MSBUILD : cordova-build error : (actual and formal argument lists differ in length) 1>MSBUILD : cordova-build error : method NativeAd.registerViewForInteraction(View,MediaView,AdIconView,List<View>) is not applicable 1>MSBUILD : cordova-build error : (actual and formal argument lists differ in length) 1>MSBUILD : cordova-build error : method NativeAd.registerViewForInteraction(View,MediaView,ImageView) is not applicable 1>MSBUILD : cordova-build error : (actual and formal argument lists differ in length) 1>MSBUILD : cordova-build error : method NativeAd.registerViewForInteraction(View,MediaView,ImageView,List<View>) is not applicable 1>MSBUILD : cordova-build error : (actual and formal argument lists differ in length) MSBUILD : cordova-build warning : Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1>MSBUILD : cordova-build error : 8 errors
> Task :app:mergeDebugJavaResource
1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception. 1>MSBUILD : cordova-build error : * What went wrong: 1>MSBUILD : cordova-build error : Execution failed for task ':app:compileDebugJavaWithJavac'. 1>MSBUILD : cordova-build error : > Compilation failed; see the compiler error output for details. 1>MSBUILD : cordova-build error : * Try: 1>MSBUILD : cordova-build error : Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
26 actionable tasks: 26 executed 1>MSBUILD : cordova-build error : * Get more help at https://help.gradle.org 1>MSBUILD : cordova-build error : BUILD FAILED in 5s 1>MSBUILD : cordova-build error : Picked up _JAVA_OPTIONS: -Xmx512M
please comment the solution if anybody knows why cordova build is failed because of this error