New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build failing with 'Could not find method google() for arguments [] on repository container' #584
Comments
Can you check that you have google() in both of these? |
|
No worries. You can find it in appName/android/app/build.gradle where appName is the root of your project. |
Oh sorry, appName/android/build.gradle is the one with the top-level repository configuration for all sub-projects/modules in the project. The one in the app folder is app specific. |
@msand Here's what that file looks like:
|
Try changing to this:
|
@msand That gives me this:
|
Make sure you have v4.1 of the gradle wrapper as well:
|
When you open/build the project in the latest Android studio, it asks if you want it to make these upgrades for you. |
Now I get:
|
Can you try cleaning and rebuilding the project? Preferably in android studio, as it gives better error messages and helpful automation for these things. |
Output from Gradle Build within Android Studio after clean & rebuild:
Appreciate the fast responses whilst trying to sort this by the way 👍 |
Now its probably the app specific build.gradle file:
|
@msand Still getting errors so going to create a new project and start and build from Android Studio to see if it resolves. Just to confirm I should be using version v6.0.1-rc.2 right? |
The last changes, the ones in the app specific build.gradle are for rc-3, everything else should work fine with rc-2 as well. |
@msand Sorted by installing rc-3 and following instructions again, built successfully after following steps here. Many thanks for your help |
@laurindo Did you try making the required changes to these three files? #583 (comment) |
Thanks for solving this but doesn't updating the API to 25-27 make the apps using this module limited to supporting only 5% of the android market? |
It should mostly make it so that newer android version don't need to run in backwards compatibility mode. The minSdkVersion 16 set the minimum sdk support level and decided how old versions it works with. https://developer.android.com/training/basics/supporting-devices/platforms.html#sdk-versions To maintain your application along with each Android release, you should increase the value of this attribute to match the latest API level, then thoroughly test your application on the corresponding platform version. |
same issue |
@nikolas7892 Check this: #465 (comment) |
@msand What is the final solution for this issue? am also facing the same issue. |
@KalaiselvanMahendran Have you tried making the changes mentioned in the previous linked comment? #465 (comment) |
@msand yeah i did, but still getting below error
|
@KalaiselvanMahendran Those instructions are for the latest version, seems you're trying to build an older one? Can you paste your package.json? |
I am getting the same error |
Seems you're using an older version of gradle. Make sure you have v4.1 in: @@ -1,5 +1,6 @@ |
@KalaiselvanMahendran @nikolas7892 @derekbar90 @jskidd3 @wassgha I've released a new version, which aligns all versions with react-native init. Please check to see everything works correctly. |
I am getting the same error: |
I got the same error when I use react-native-sqlite-storage , only this website solve my problem , |
Just delete the whole android folder and run a command to add. |
I Got an error that Could not find method google() for arguments [] on object of type org.gradle.api.internal.initialization.DefaultScriptHandler. and my build.gradle looks like this buildscript {
allprojects {
} would you please help me it fix this |
Message shown in console after
react-native run-android
:I installed the plugin in a fresh project on OSX. Versions:
My package.json looks like this:
Any ideas as to how I can fix this?
The text was updated successfully, but these errors were encountered: