customerio / customerio-reactnative

MIT License
23 stars 11 forks source link

Error pod install #263

Closed danielamorimp closed 2 months ago

danielamorimp commented 2 months ago

SDK version: 3.7.0

Environment: Development and Production

Are logs available? error Failed to build the app: No package name found. Found errors in /Users/imac/Documents/instacarro/ic-auctions-app/node_modules/customerio-reactnative/android/src/main/AndroidManifest.xml.

[!] Invalid Podfile file: unexpected token at 'info Run CLI with --verbose flag for more details. '.

from /Users/imac/Documents/instacarro/ic-auctions-app/ios/Podfile:8

-------------------------------------------

target 'auctions' do

config = use_native_modules!

-------------------------------------------

Describe the bug When doing the 'pod install' command the error presented above is generated

To Reproduce install node_moduler with yarn install, access the ios folder, and use pod install to install the pods

Expected behavior When using the pod install command the error mentioned will occur

Shahroz16 commented 2 months ago

Hey @danielamorimp, can you please check your android Gradle plugin version?

As mentioned in the docs, It needs to be greater or equal to 7.4.1. You can find it in your android/build.gradle file.

danielamorimp commented 2 months ago

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

buildscript { ext { buildToolsVersion = "31.0.0" minSdkVersion = 22 compileSdkVersion = 33 targetSdkVersion = 33 ndkVersion = "21.4.7075529" if (System.properties['os.arch'] == "aarch64") { // For M1 Users we need to use the NDK 24 which added support for aarch64 ndkVersion = "24.0.8215888" } else { // Otherwise we default to the side-by-side NDK version from AGP. ndkVersion = "21.4.7075529" } } repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle:7.4.1") classpath("com.facebook.react:react-native-gradle-plugin") classpath("de.undercouch:gradle-download-task:5.0.1") classpath("com.google.gms:google-services:4.3.10") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }

allprojects { repositories { mavenCentral() 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()
    maven { url 'https://www.jitpack.io' }
    maven { url 'https://maven.gist.build' }
}

}

ndroid/gradle/wrapper/gradle-wrapper.properties :

distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists

danielamorimp commented 2 months ago

Another error that also appeared was this:

Task :customerio-reactnative:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

Shahroz16 commented 2 months ago

JDK 17 is needed for it. Can you please try the methods mentioned in here to update it? And then delete node modules so cache get reset and try again?

danielamorimp commented 2 months ago

I updated my jdk, I also updated my project, the error persists.

danielamorimp commented 2 months ago

When I generate the APK without modifying the AndroidManifest from the customer-io library, the following error is shown:

Starting a Gradle Daemon, 3 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

This only happened after I updated the library.

Shahroz16 commented 2 months ago

@danielamorimp what react native version are you using? seems like something similar to this?

ZhaniM commented 2 months ago

@danielamorimp I fixed this by adding the package name of the app on the manifest tag on here: node_modules/customerio-reactnative/android/src/main/AndroidManifest.xml.

danielamorimp commented 2 months ago

@ZhaniM, I did this, the pods were generated, but when generating the release version for Android, I gave an error. Were you able to generate the release version for Android? @Shahroz16, my react version: "react-native": "0.70.6"

and I don't use any cli packages

adnan-khan1122 commented 2 months ago

@danielamorimp I got the same errors; please let me know if you were able to resolve this issue; thanks.

Shahroz16 commented 2 months ago

Hey @danielamorimp can you try updating the react native version? Maybe 0.71 or 0.72? I think that might solve it.

danielamorimp commented 2 months ago

Good evening, react native updated to version "0.71.0", and the error still persists

Do you know if the team responsible for the SDK tried to reproduce the error? were reported by more than one developer, the only workaround we had was to modify the lib file, which is not the most correct. Since it seems like a chronic SDK error, wouldn't a correction patch be necessary? I had to update several files in my project to achieve the same result.

If it is necessary to provide files to reproduce the error, I am available

Shahroz16 commented 2 months ago

Hey @danielamorimp the latest release of the SDK is for the support of Gradle 8. So if you haven't updated to Gradle 8, it's perfectly alright if you don't update to this release either. Does downgrading to a version before not resolve the issue for you?

Shahroz16 commented 2 months ago

And, if you can send a sample app to reproduce it, that would be so helpful. In case you want to update to latest version.

danielamorimp commented 2 months ago

I had done the update because it was recommended by the customer team, but ok. I went back to version "3.1.10" and it works @adnan-khan1122 , @ZhaniM , set the version "customerio-reactnative": "3.1.10" without the "^", it will probably work.

thanks

Shahroz16 commented 2 months ago

@danielamorimp that's great to hear that it's working now, and apologies for the confusion. 3.6.0 should also work as its not targeting Android Gradle 8 as well.

Gradle 8 does bring a lot of benefits with itself, so if you ever decide to update your Android gradle version to 8, 3.7.0 should work just fine with it.