Skip to content
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

android build issue -> Could not find com.android.volley:volley:1.1.1 #301

Open
Kalebcoding opened this issue Jan 13, 2022 · 14 comments
Open

Comments

@Kalebcoding
Copy link

image

This is the above error message I got when trying to build my react-native app for android. It appears to be trying to retrieve this package for the com.google.android.libraries.places:places:1.1.0 dependency listed in react-native-google-places version 3.1.2's android app/build.gradle file.

I think this was an error due to an outage with jcenter repos from what I can tell. Upon doing some research I was able to find out that com.google.android.libraries.places:places:1.2.0 is available on a stable maven repo and is backwards compatible with com.google.android.libraries.places:places:1.1.0.

To get my app building again I just added this to react-native-google-places android/build.grade file inside of node_modules:

implementation('com.google.android.libraries.places:places:1.1.0') {
        exclude group: 'com.android.volley'
    }
 implementation 'com.android.volley:volley:1.2.0'
@kdrakcay
Copy link

kdrakcay commented Mar 6, 2022

Where exactly did you paste it in this file?
build.gradle.txt
please help.

@Kalebcoding
Copy link
Author

@kdrakcay After you run npm install or yarn install for your project. You'll add it to:

.../node_modules/react-native-google-places/android/build.gradle

As a side note. You will need to do this every time you delete the node_modules folder from your project. If you want to automate adding this to that gradle file instead of having to do it every time you can use an npm package called patch-package (https://www.npmjs.com/package/patch-package).

@amdounio
Copy link

Hello ,
I solve the problem changing

implementation "com.google.android.libraries.places:places:1.1.0

in node_modules\react-native-google-places\android build.gradle file

implementation('com.google.android.libraries.places:places:1.1.0') {
exclude group: 'com.android.volley'
}
implementation 'com.android.volley:volley:1.2.0'

Thanks

@fcaldarelli
Copy link

fcaldarelli commented Jan 18, 2023

@tolu360 this issue is fixed by PR #304 . Could you merge it?

@Yigityakut
Copy link

Did anyone find a solution to this? This exclude group solution didn't work for me. It started giving more errors.

@fcaldarelli
Copy link

@Yigityakut what errors do you receive?

@Yigityakut
Copy link

@fcaldarelli Here is the error I get

/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesPlaceFieldEnum.java:4: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:11: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:12: error: package android.support.annotation does not exist
import android.support.annotation.RequiresPermission;
                                 ^
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:13: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
                                 ^
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:14: error: cannot find symbol
import  android.support.v4.app.ActivityCompat;
                              ^
  symbol:   class ActivityCompat
  location: package android.support.v4.app
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesPlaceFieldEnum.java:45: error: cannot find symbol
    @Nullable
     ^
  symbol:   class Nullable
  location: class RNGooglePlacesPlaceFieldEnum
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:326: error: cannot find symbol
    @RequiresPermission(allOf = {ACCESS_FINE_LOCATION, ACCESS_WIFI_STATE})
     ^
  symbol:   class RequiresPermission
  location: class RNGooglePlacesModule
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:514: error: cannot find symbol
    @Nullable
     ^
  symbol:   class Nullable
  location: class RNGooglePlacesModule
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:306: error: cannot find symbol
        if (ContextCompat.checkSelfPermission(this.reactContext.getApplicationContext(), permission.ACCESS_WIFI_STATE)
            ^
  symbol:   variable ContextCompat
  location: class RNGooglePlacesModule
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:308: error: cannot find symbol
        || ContextCompat.checkSelfPermission(this.reactContext.getApplicationContext(), permission.ACCESS_FINE_LOCATION)
           ^
  symbol:   variable ContextCompat
  location: class RNGooglePlacesModule
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:573: error: cannot find symbol
            ContextCompat.checkSelfPermission(this.reactContext.getApplicationContext(), permission) == PackageManager.PERMISSION_GRANTED;
            ^
  symbol:   variable ContextCompat
  location: class RNGooglePlacesModule
/Users/yigit/Desktop/tempproj/VindenApp/node_modules/react-native-google-places/android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:575: error: cannot find symbol
            ActivityCompat.requestPermissions(currentActivity, new String[]{permission}, 0);
            ^
  symbol:   variable ActivityCompat
  location: class RNGooglePlacesModule
12 errors

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-google-places: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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 26s

    at makeError (/Users/yigit/Desktop/tempproj/VindenApp/node_modules/execa/index.js:174:9)
    at /Users/yigit/Desktop/tempproj/VindenApp/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/Users/yigit/Desktop/tempproj/VindenApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:82:7)
    at async Command.handleAction (/Users/yigit/Desktop/tempproj/VindenApp/node_modules/@react-native-community/cli/build/index.js:108:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.

Also here is my build.gradle


// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "31.0.0"
        minSdkVersion = 21
        compileSdkVersion = 33
        targetSdkVersion = 33
        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"
    }
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        google()
        mavenCentral()
        jcenter() //by adding this
        maven { url 'https://www.jitpack.io' }
        maven { url "https://maven.google.com" }
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.3.1")
        classpath("com.facebook.react:react-native-gradle-plugin")
        
    }
}

@Yigityakut
Copy link

I'm completely stuck with this for the last 2 days and I feel like I tried everything. At this point, looking for alternative libraries even though I'm short on time. If you have a fix to this, I'd appreciate it a lot.

@fcaldarelli
Copy link

What React Native Google Places version are you using?

@Yigityakut
Copy link

3.1.2

What React Native Google Places version are you using?

@gulsher7
Copy link

try npx jetify that's it

@kyadalu1
Copy link

@kyadalu1
Copy link

kyadalu1 commented Jan 6, 2024

Try this

@vg3900
Copy link

vg3900 commented Feb 7, 2024

What is the solution for this?
@Yigityakut I am facing same errors. Did you fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants