Open halkoy opened 5 years ago
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
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.
@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:
> 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
hello, Phonegap can not build this plugin for android. Would you please update the latest sdk