This repository was archived by the owner on Jun 16, 2023. It is now read-only.
This repository was archived by the owner on Jun 16, 2023. It is now read-only.
Could not find method google() for arguments [] on repository container #1530
Closed
Description
Hi all,
I am having this error after i install react native camera. Can anyone help me. I have changed build.gradle dependency classpath to 3 also. But nothing is working. Any ideas?
error -
A problem occurred evaluating project ':react-native-camera'.
Could not find method google() for arguments [] on repository container.
Activity
Adwich commentedon May 1, 2018
What version of react, react-native and react-native-camera do you use ?
ghost commentedon May 1, 2018
Hi, @Adwich
I'm running through this same issue, my react and react-native versions are:
react-native-cli: 2.0.1
react-native: 0.55.3
react: 16.3.1
react-native-camera: 1.1.2
code-by commentedon May 1, 2018
same issue
react-native-cli: 2.0.1
react-native: 0.55.3
react-native-camera: 1.1.2
24 commentedon May 1, 2018
set gradle-wrapper.properties
set build.gradle
Adwich commentedon May 2, 2018
I got the problem using react-native 0.55.0 . Try downgrading react-native. I'm using react-native 0.53.3 and react-native-camera 1.0.3 without problem.
lech-code-monkey commentedon May 2, 2018
I have the same error:

PasinduDineth commentedon May 2, 2018
@24 after editing as you told, im getting this error,
Android dependency 'com.android.support:support-v4' has different version for the compile (23.0.1) and runtime (27.1.0) classpath. You should manually set the same version via DependencyResolution
any help?
ma3dau commentedon May 2, 2018
@PasinduDineth it can be solved by excluding "com.android.support" from react-native-camera implementation in
/android/app/build.gradle
jgfidelis commentedon May 2, 2018
@ma3dau Beware that if you exclude the support lib and not add it for compilation correctly on the build.gradle, your app will crash when taking a picture.
code-by commentedon May 2, 2018
@PasinduDineth
#1532
https://github.com/react-native-community/rncamera-example
harshaSenaratne commentedon May 4, 2018
@PasinduDineth
This worked for me : Make sure your react native version first , if you are using react-native < 0.40 then
npm install --save react-native-camera@0.4
. If react-native > 0.40 then donpm install --save react-native-camera@0.6
. Link the react-native-camera usingreact-native link react-native-camera
Follow the steps below after linking.
1. removed PropTypes from
import React, { Component, PropTypes } from 'react';
2. add
import PropTypes from 'prop-types';
in package.json.
1. add in "dependencies"
"prop-types": "^15.6.0"
x3388638 commentedon May 4, 2018
@PasinduDineth
I use the code @24 provided but get the same problem
however it was solved by adding the following code in
android/build.gradle
and changing
compileSdkVersion
&buildToolsVersion
inandroid/app/build.gradle
finally, it works
modules version
841660202 commentedon May 5, 2018
who tell me how to solve it?
6 remaining items
kkusanagi commentedon May 24, 2018
I'm using react-native-camera@0.10 version for com.android.tools.build:gradle:2.2.+ which is quite stable for that version.
Once update the gradle, build version, react-native-camera, build.gradle, the whole system just crash. and don't know how to fix it. Really need some technical support / advice on how to upgrade properly.
By following android official migrate steps, only fix the latest react-native version, but for other plugin, all just crash.
Anyone who can create a blog about how to upgrade version would be helpful.
Enigma10 commentedon May 30, 2018
Hey Guys , My error got fixed with combination of @24 and @x3388638 solutions. :) .
mgiacopu commentedon May 30, 2018
@ma3dau your changes make the app compile but when I try to open the scanner it crashes without errors... I still don't get why the first error showed up.
mgiacopu commentedon May 30, 2018
Instead, a combination of @24 and @x3388638 codes gives the final solution.
Now it works like a charm.
Thank you guys! Thumbs up!
kk412027247 commentedon Jun 22, 2018
Combine @24 and @x3388638 codes, than I get a final solution.
I make a combine edition here,
android/build.gradle
android/gradle/wrapper/gradle-wrapper.properties
android/app/build.gradle
ADDITION
If your project has other android package like react-native-image-picker, when you run
./gradlew assembleRelease
, you probably get a errorAAPT: resource android:attr/colorError not found.
In order to fix this, you should make sure the compile version of the package match to your project.
The following code do this work.
MORE
If you get a error : uncompiled PNG file passed as argument. Must be compiled first into .flat file.. error: failed parsing overlays.
modify
./android/gradle.properties
, add the following code.-> click here to get my project example <-
blogdaren commentedon Jul 1, 2018
@kk412027247 tks for your final solution with combination @24 and @x3388638 codes, it really works well.
bbeckk commentedon Jul 18, 2018
This solves the issue: https://github.com/react-native-community/react-native-camera/blob/master/docs/GradleUpgradeGuide.md
However it gives an warning but build is successful.
sospedra commentedon Sep 27, 2018
@kk412027247 comment should be on the official docs! Many thanks! Saved my day <3
gokujy commentedon Dec 7, 2018
I am getting the same error:
Could not find method google() for arguments [] on repository container
Solve: I'm working on firebase crud and i installed angularfire2 and firebase plugin both.
So i uninstall firebase and error solved, i mean this error coming because conflict.
gabrielbabierra commentedon Jan 20, 2019
Anyone have the same issue as mine after @kk412027247 's compiled edition changes. I have a build succesful but when i run my terminal i have an error:
Bundling
index.android.js
[development, non-minified] 0.0% (0/1), failed.error: bundling failed: Error: Couldn't find preset "module:metro-react-native-babel-preset" relative to directory "/Users/Cyberland/Desktop/AttApp"