tolu360 / react-native-google-places

iOS/Android Google Places Widgets (Autocomplete Modals) and API Services for React Native Apps
567 stars 289 forks source link

patch-package react-native-google-places+3.1.2.patch #303

Open xDemon200 opened 2 years ago

xDemon200 commented 2 years ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-google-places@3.1.2 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-google-places/android/.project b/node_modules/react-native-google-places/android/.project
index 3964dd3..631d67a 100644
--- a/node_modules/react-native-google-places/android/.project
+++ b/node_modules/react-native-google-places/android/.project
@@ -1,10 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-   <name>android</name>
+   <name>react-native-google-places</name>
    <comment>Project android created by Buildship.</comment>
    <projects>
    </projects>
    <buildSpec>
+       <buildCommand>
+           <name>org.eclipse.jdt.core.javabuilder</name>
+           <arguments>
+           </arguments>
+       </buildCommand>
        <buildCommand>
            <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
            <arguments>
@@ -12,6 +17,18 @@
        </buildCommand>
    </buildSpec>
    <natures>
+       <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
    </natures>
+   <filteredResources>
+       <filter>
+           <id>1650489151686</id>
+           <name></name>
+           <type>30</type>
+           <matcher>
+               <id>org.eclipse.core.resources.regexFilterMatcher</id>
+               <arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
+           </matcher>
+       </filter>
+   </filteredResources>
 </projectDescription>
diff --git a/node_modules/react-native-google-places/android/.settings/org.eclipse.buildship.core.prefs b/node_modules/react-native-google-places/android/.settings/org.eclipse.buildship.core.prefs
index e889521..1675490 100644
--- a/node_modules/react-native-google-places/android/.settings/org.eclipse.buildship.core.prefs
+++ b/node_modules/react-native-google-places/android/.settings/org.eclipse.buildship.core.prefs
@@ -1,2 +1,2 @@
-connection.project.dir=
+connection.project.dir=../../../android
 eclipse.preferences.version=1
diff --git a/node_modules/react-native-google-places/android/build.gradle b/node_modules/react-native-google-places/android/build.gradle
index e9ffd1f..8242bda 100644
--- a/node_modules/react-native-google-places/android/build.gradle
+++ b/node_modules/react-native-google-places/android/build.gradle
@@ -45,7 +45,7 @@ dependencies {
     def supportLibVersion = safeExtGet('supportLibVersion', DEFAULT_SUPPORT_LIB_VERSION)

     implementation "com.facebook.react:react-native:+"
-    implementation "com.google.android.libraries.places:places:1.1.0"
+    implementation 'com.google.android.libraries.places:places:2.5.0'
     implementation 'androidx.appcompat:appcompat:1.0.0'
     implementation 'androidx.legacy:legacy-support-v4:1.0.0'
     implementation "com.google.code.findbugs:jsr305:3.0.2"
diff --git a/node_modules/react-native-google-places/react-native-google-places.podspec b/node_modules/react-native-google-places/react-native-google-places.podspec
index 7445c14..9b5d949 100644
--- a/node_modules/react-native-google-places/react-native-google-places.podspec
+++ b/node_modules/react-native-google-places/react-native-google-places.podspec
@@ -18,6 +18,8 @@ Pod::Spec.new do |s|

   s.compiler_flags = '-DHAVE_GOOGLE_MAPS=1', '-fno-modules'

+  s.static_framework = true
+
   s.dependency 'React'
   s.dependency 'GooglePlaces', '~> 3.1.0'
   s.dependency 'GoogleMaps', '~> 3.1.0'

This issue body was partially generated by patch-package.

mbrimmer83 commented 2 years ago

@xDemon200 Did you happen to fork this package? I am not sure if this is being maintained anymore. Would love to use your fork if you were able to successfully patch it and it's available.

princefishthrower commented 2 years ago

@xDemon200 - what version of react-native-maps are you using? I found for this library to be compatible I needed both the GooglePlaces and the GoogleMaps pods to be 7.0.0, but then I think I'm running into deprecation issues with the source code of this library when trying to build or run on Xcode. I mean GoogleMaps 3.1.0 is a pod from April 2019 (https://developers.google.com/maps/documentation/ios-sdk/release-notes#2019-04-16), no idea why this library is still using it. In order to use the latest version of react-native-maps on our app, we've unfortunately had to move away from using this library due to these broken compatibility issues

danielmontgomery commented 2 years ago

@princefishthrower Did you find a good alternative to this library? I'm running into the same issues you've mentioned. Thanks.