sbugert / react-native-admob

A react-native component for Google AdMob banners
BSD 2-Clause "Simplified" License
1.13k stars 532 forks source link

react-native-admob:compileDebugJavaWithJavac #520

Open bilalkarakollu opened 4 years ago

bilalkarakollu commented 4 years ago

I added to the project I just created. The paths I followed are as follows;

1-npm i react-native-admob -S 2-react-native link 3-AndroidManifest : android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy" my-id! 4-android/settings.gradle

include ':RNAdMob', ':app' project(':RNAdMob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-admob/android') 5-android/app/build.gradle

dependencies { ... compile project(':RNAdMob') }

6-android>app>src>main>java>com>myproje(admobdeneme)>MainAplication.java import com.sbugert.rnadmob.RNAdMobPackage; I added as follows: protected List getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); packages.add( new MainReactPackage()); packages.add( new RNAdMobPackage()); return packages; }

the error ı got =

Task :react-native-admob:compileDebugJavaWithJavac FAILED

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.0.1/userguide/command_line_interface.html#sec:command_line_warnings 12 actionable tasks: 2 executed, 10 up-to-date C:\Users\Asus\Desktop\reactNative\admobdeneme\node_modules\react-native-admob\android\src\main\java\com\sbugert\rnadmob\RNAdMobRewardedVideoAdModule.java:20: error: RNAdMobRewardedVideoAdModule is not abstract and does not override abstract method onRewardedVideoCompleted() in RewardedVideoAdListener public class RNAdMobRewardedVideoAdModule extends ReactContextBaseJavaModule implements RewardedVideoAdListener { ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error

FAILURE: Build failed with an exception.

BU�LD FAILED in 6s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 C:\Users\Asus\Desktop\reactNative\admobdeneme\node_modules\react-native-admob\android\src\main\java\com\sbugert\rnadmob\RNAdMobRewardedVideoAdModule.java:20: error: RNAdMobRewardedVideoAdModule is not abstract and does not override abstract method onRewardedVideoCompleted() in RewardedVideoAdListener public class RNAdMobRewardedVideoAdModule extends ReactContextBaseJavaModule implements RewardedVideoAdListener { ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error

FAILURE: Build failed with an exception.

BU�LD FAILED in 6s

at makeError (C:\Users\Asus\Desktop\reactNative\admobdeneme\node_modules\execa\index.js:174:9)
at C:\Users\Asus\Desktop\reactNative\admobdeneme\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\Asus\Desktop\reactNative\admobdeneme\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\Asus\Desktop\reactNative\admobdeneme\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)

PS C:\Users\Asus\Desktop\reactNative\admobdeneme>

mahenk1 commented 4 years ago

Any fix for this problem ? Facing the same issue !

bilalkarakollu commented 4 years ago

Any fix for this problem ? Facing the same issue !

i couldn't find yet

mahenk1 commented 4 years ago

Found something that might help ! Try installing latest version (2.0.0-beta.6) and follow the instructions, this issue seems to be in 1.3.2

bilalkarakollu commented 4 years ago

Found something that might help ! Try installing latest version (2.0.0-beta.6) and follow the instructions, this issue seems to be in 1.3.2

npm i --save react-native-admob@next

Did you find a solution using this ?

Can you explain what you did in order please ?

sametpalitci commented 3 years ago

try this: cd android gradlew clean cd .. npx react-native run-android

ahmad923245 commented 3 years ago

with beta version there is new error which is mention in issue's

ahmad923245 commented 3 years ago

try this: cd android gradlew clean cd .. npx react-native run-android

not working bro

laibagill commented 3 years ago

facing same error

yalcinozer commented 3 years ago

Still an issue

mpaulosouza commented 3 years ago

Has anyone found the solution to this problem?

ahmad923245 commented 3 years ago

yes i solve using Android studio

On Fri, Feb 26, 2021, 9:17 PM Marcos Paulo de Souza < notifications@github.com> wrote:

Has anyone found the solution to this problem?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sbugert/react-native-admob/issues/520#issuecomment-786744357, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALIGS3YNO7CU2Z2W2EL6U6DTA7CRDANCNFSM4NDXC4EQ .

Shisso23 commented 3 years ago

replace. implementation 'com.google.android.gms:play-services-ads:+.'

In node-modules/react-native-admob/android/build.gradle

With ==>. implementation 'com.google.android.gms:play-services-ads:19.8.0'

And patch package

bethea28 commented 3 years ago

replace. implementation 'com.google.android.gms:play-services-ads:+.'

In node-modules/react-native-admob/android/build.gradle

With ==>. implementation 'com.google.android.gms:play-services-ads:19.8.0'

And patch package

I solved for android by adding . implementation 'com.google.android.gms:play-services-ads:16.0.0' instead for that build.gradle and it fixed my android and broke ios...react native. Do you know if it has to be specifically 19.8.0 being that there may be something wrong with 16.0.0 ?

bethea28 commented 3 years ago

yes i solve using Android studio On Fri, Feb 26, 2021, 9:17 PM Marcos Paulo de Souza < @.***> wrote: Has anyone found the solution to this problem? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#520 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALIGS3YNO7CU2Z2W2EL6U6DTA7CRDANCNFSM4NDXC4EQ .

Hey I was wondering how you solved this issue..thanks!

pingpos commented 3 years ago

I've had the same issue for several days. No change in my code and I have no idea where it can come from...

berkelmas commented 3 years ago

replace. implementation 'com.google.android.gms:play-services-ads:+.'

In node-modules/react-native-admob/android/build.gradle

With ==>. implementation 'com.google.android.gms:play-services-ads:19.8.0'

And patch package

Thanks this worked well 👍

balki14101 commented 2 years ago

You can solve this issue by replacing a line in node-modules/react-native-admob/android/build.gradle

Replace => implementation 'com.google.android.gms:play-services-ads:+.'

With => implementation 'com.google.android.gms:play-services-ads:19.8.0'