react-native-admob icon indicating copy to clipboard operation
react-native-admob copied to clipboard

react-native-admob:compileDebugJavaWithJavac

Open bilalkarakollu opened this issue 4 years ago • 17 comments

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<ReactPackage> getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List<ReactPackage> 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.

  • What went wrong: Execution failed for task ':react-native-admob: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

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.

  • What went wrong: Execution failed for task ':react-native-admob: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

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>

bilalkarakollu avatar May 18 '20 04:05 bilalkarakollu

Any fix for this problem ? Facing the same issue !

mahenk1 avatar May 24 '20 20:05 mahenk1

Any fix for this problem ? Facing the same issue !

i couldn't find yet

bilalkarakollu avatar May 24 '20 20:05 bilalkarakollu

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

mahenk1 avatar May 24 '20 22:05 mahenk1

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 ?

bilalkarakollu avatar May 24 '20 22:05 bilalkarakollu

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

sametpalitci avatar Aug 03 '20 14:08 sametpalitci

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

ahmad923245 avatar Jan 08 '21 17:01 ahmad923245

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

not working bro

ahmad923245 avatar Jan 08 '21 17:01 ahmad923245

facing same error

laibagill avatar Feb 17 '21 09:02 laibagill

Still an issue

yalcinozer avatar Feb 25 '21 13:02 yalcinozer

Has anyone found the solution to this problem?

mpaulosouza avatar Feb 26 '21 16:02 mpaulosouza

yes i solve using Android studio

On Fri, Feb 26, 2021, 9:17 PM Marcos Paulo de Souza < [email protected]> 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 .

ahmad923245 avatar Feb 26 '21 16:02 ahmad923245

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

Shisso23 avatar Apr 09 '21 13:04 Shisso23

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 avatar Apr 09 '21 21:04 bethea28

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!

bethea28 avatar Apr 09 '21 21:04 bethea28

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

pingpos avatar Apr 12 '21 18:04 pingpos

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 👍

berkelmas avatar May 01 '21 13:05 berkelmas

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'

balki14101 avatar Oct 13 '21 10:10 balki14101