faizalshap / react-native-otp-verify

React native sms verification without additional permissions
MIT License
241 stars 95 forks source link

Android Build is failing #66

Closed kousiclattala closed 1 year ago

kousiclattala commented 1 year ago

When i build the release apk i get below error.

Screenshot 2022-11-02 192441

so i added the configuration mentioned in the package documentation, then i got below error

Screenshot 2022-11-02 193936

I have installed the latest version of the package

"react-native-otp-verify": "^1.1.3", "react": "18.0.0", "react-native": "0.69.0",

faizalshap commented 1 year ago

You don't need to have that import there @kousiclattala

kousiclattala commented 1 year ago

Okay, but when i removed that and try to build i got the above error android resource linking failed.

What should i have to do?

joaofernandesbytepitch commented 1 year ago

Got the same error.

"react-native-otp-verify": "^1.1.4", "react": "18.0.0", "react-native": "0.69.6",

Any advice?

joaofernandesbytepitch commented 1 year ago

@kousiclattala manually setting sdk version on the build.gradle file did the trick for me.

android {
  compileSdkVersion safeExtGet('OtpVerify_compileSdkVersion', 31)
  defaultConfig {
    minSdkVersion safeExtGet('OtpVerify_minSdkVersion', 21)
    targetSdkVersion safeExtGet('OtpVerify_targetSdkVersion', 31)
    versionCode 2
    versionName "1.0"
  }
  ...
}

@faizalshap do you think this can be fixed on my end without the need to update this on the package?

faizalshap commented 1 year ago

@kousiclattala what sdk version you are using i will check with RN v0.69 @joaofernandesbytepitch looks like sdk issue to me as well

AliYar-Khan commented 1 year ago

Getting error on "react-native-otp-verify": "^1.0.5", RN: "react-native": "0.66.5", ext.kotlin_version = '1.6.0' buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 30 targetSdkVersion = 30 ndkVersion = "20.1.5948944"

LeonardoCalazans commented 1 year ago

Error compile in android

Execution failed for task ':react-native-otp-verify:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-otp-verify:debugCompileClasspath'.
   > Could not find com.google.android.gms:play-services-auth:16.1.0.
     Required by:
         project :react-native-otp-verify

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

I need help

faizalshap commented 1 year ago

@AliYar-Khan please update to latest version @LeonardoCalazans do you have google() in your repository section in project level build.gradle file?

sudeshvs commented 1 year ago

@kousiclattala

note : Go to android/app/src/main/java/[...]/MainApplication.java

then remove this line : import com.faizal.OtpVerify.OtpVerifyPackage;

go to android/settings.gradle and remove the code you added...

because you are using autoLinking... this line is not needed..

one more thing ./gradlew clean

delete node modules and yarn install

happy Coding

LeonardoCalazans commented 1 year ago

@AliYar-Khan please update to latest version @LeonardoCalazans do you have google() in your repository section in project level build.gradle file?

My solution was has to change version googlePlayServicesVersion = "16.1.0" to googlePlayServicesVersion = "20.3.0" I need test lib, but build is success.

faizalshap commented 1 year ago

Please check if updating the googlePlayServicesVersion = "16.1.0" to googlePlayServicesVersion = "20.3.0" works ?

brunocdeveloper commented 1 year ago

same problem here, should only fix it when they merge the pull that updates the sdk version

faizalshap commented 1 year ago

Merged