razorpay / react-native-razorpay

React Native wrapper for Razorpay's mobile SDKs
https://www.npmjs.com/package/react-native-razorpay
MIT License
124 stars 107 forks source link

Task :app:processDebugManifest FAILED i got this error my react native v6.3 #289

Closed anujec722 closed 3 years ago

anujec722 commented 4 years ago

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings 364 actionable tasks: 4 executed, 360 up-to-date C:\Users\ss\simi\android\app\src\debug\AndroidManifest.xml Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.razorpay:checkout:1.6.3] C:\Users\ss.gradle\caches\transforms-2\files-2.1\fe7c39f37fed113d582c901e55ce7d35\checkout-1.6.3\AndroidManifest.xml as the library might be using APIs not available in 16 Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk version to at least 19, or use tools:overrideLibrary="com.razorpay" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

BUILD FAILED in 23s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 C:\Users\ss\simi\android\app\src\debug\AndroidManifest.xml Error:

vivekshindhe commented 4 years ago

Hey @anujec722 Thanks for reaching out to us. So, the deal here is that the SDK uses minVersion of 19. Because 16 is just a bit too outdated right now. Here's how you can change the minSdkVersion on your project,

root_project_folder/android/build.gradle and change minSdkVersion to 19.

Let me know if this resolves the issue for you.

Thanks

veermetri05 commented 4 years ago

I also faced this issue and changing the minSdkVersion from 16 to 19 in android/build.gradle solved the problem it is working fine now. Thanks for your response @vivekshindhe

Daniyalzakir321 commented 3 years ago

INSIDE /android/build.gradle

buildscript { ext { buildToolsVersion = "29.0.2" minSdkVersion = 21 // <--now use this compileSdkVersion = 29 targetSdkVersion = 29 } }

image

shasank27 commented 3 years ago

Where should I change? There's no option to do it `buildscript { repositories { google() jcenter() }

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.3'
}

}

allprojects { repositories { google() jcenter() } }

rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(':app') }

task clean(type: Delete) { delete rootProject.buildDir }

`

vivekshindhe commented 3 years ago

@shasank27 You are checking the wrong build.gradle file. There are two, build.gradle(:project_name) & build.gradle(:app). build.gradle(:app) is where you'll find the option to change. It'll be inside defaultConfig tag in android

shasank27 commented 3 years ago

Thank you. @vivekshindhe It's fixed now

Esmeralda22765 commented 3 years ago

Thank you. @vivekshindhe It's fixed now

How did you fix it?

mharis17 commented 3 years ago

INSIDE /android/build.gradle

buildscript { ext { buildToolsVersion = "29.0.2" minSdkVersion = 21 // <--now use this compileSdkVersion = 29 targetSdkVersion = 29 } }

image

buildscript { ext { buildToolsVersion = "29.0.2" minSdkVersion = 19 compileSdkVersion = 28 targetSdkVersion = 28 } used this combination ,got the same error..

vivekshindhe commented 3 years ago

@mharis17 The minSdkVersion should be 21. This is because of the library 'react-native-image-picker'. Doesn't have anything to do with Razorpay's Library. This should solve your problem though.

ankit1456 commented 2 years ago

IMG-20211217-WA0001 Any fix for this issue? please help me

AkibShaikh18 commented 2 years ago

@ankit1456 if u installed already old build from android studio or anywhere...try after removing it

specter1997 commented 2 years ago

IMG-20211217-WA0001 Any fix for this issue? please help me

I have the same problem. If there is any solution plz??

homosape commented 2 years ago

Same problem here on fresh react native project.

> Task :app:processDebugMainManifest FAILED
11 actionable tasks: 2 executed, 9 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @36db065a

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

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @36db065a

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

    at makeError (/Users/ika/Desktop/test/node_modules/execa/index.js:174:9)
    at /Users/ika/Desktop/test/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async runOnAllDevices (/Users/ika/Desktop/test/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/Users/ika/Desktop/test/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
Luttennet commented 2 years ago

@homosape did you solved it? i have the same issue

homosape commented 2 years ago

@Luttennet yes downgrading java version has helped in my scenario.

my java version now

openjdk 11.0.15 2022-04-19
OpenJDK Runtime Environment Homebrew (build 11.0.15+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.15+0, mixed mode)
Luttennet commented 2 years ago

@homosape thanks mate, helped me too! I didn't even notice it changed to 18 (I think android studio downloaded it auto sadly) thank you

Lyle-Rogers commented 2 years ago

This is the main error I had: > Task :app:processDebugMainManifest FAILED

I fixed it by adding android:exported="true" to the \android\app\src\main\AndroidManifest.xml files activity section. For example: `<activity android:name=".MainActivity" android:exported="true"> // <- add it here. ! . !

` and just after cd .\android\ & ./gradlew clean!

mehraj43 commented 1 year ago

image

mehraj43 commented 1 year ago

help me guyz stuck with this issue for 2 days couldn't find any solution

mehraj43 commented 1 year ago

i uninstalled admob even then same issue

vivekshindhe commented 1 year ago

@mehraj43 this doesn't have anything to do with the react-native-razorpay package. But, the activity EmptyFloatingActivity needs to have android:exported to be set to true or false in the AndroidManifest.xml. The location of the file is given in the error message you posted above. Adding that should solve it for you

mehraj43 commented 1 year ago

there is no activity in my file such as EmptyFloatingActivity can u tell me specifically

mehraj43 commented 1 year ago

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.supersports">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
  android:name=".MainApplication"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:roundIcon="@mipmap/ic_launcher_round"
  android:allowBackup="false"
  android:theme="@style/AppTheme">

  <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
  <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>

  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
    android:launchMode="singleTask"
    android:windowSoftInputMode="adjustResize"
    android:exported="true"
    android:screenOrientation="portrait" 
     >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>

<activity android:name="com.facebook.FacebookActivity"
    android:configChanges=
            "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
    android:label="@string/app_name" />
<activity
    android:name="com.facebook.CustomTabActivity"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="@string/fb_login_protocol_scheme" />
    </intent-filter>
</activity>

</application>

this manifest of main location

mehraj43 commented 1 year ago

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application
    android:usesCleartextTraffic="true"
    tools:targetApi="28"
    tools:ignore="GoogleAppIndexingWarning">
    <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>

this is of debug location

mehraj43 commented 1 year ago

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.android.ads.consent" >

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="26" />

mehraj43 commented 1 year ago
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application
    android:usesCleartextTraffic="true"
    tools:targetApi="28"
    tools:ignore="GoogleAppIndexingWarning">
    <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>

this is of debug location

the error is of this location how do i add the activity

vivekshindhe commented 1 year ago

@mehraj43 <activity android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity" android:exported="false" /> <activity android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity" android:exported="false" /> <activity android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity" android:exported="false" />

add these lines to your Application's AndroidManifest.xml file.

mehraj43 commented 1 year ago

thanks already did its resolve i think now was able to do bcoz of ur previoys reply thanks man

mehraj43 commented 1 year ago

image

a new error occured now

vivekshindhe commented 1 year ago

The error is in react-native-fbsdk-next. They would be able to help you out there

mehraj43 commented 1 year ago

The error is in react-native-fbsdk-next. They would be able to help you out there

ok thanks

MostafaHamdy3 commented 1 year ago

How can I solve this issue, plz It occurs when I'm trying to run a React native project. I'm trying to solve this issue 2days ago.

image

MrGautamojha commented 4 months ago

I am getting same error

Using ext { buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33 }

Screenshot 2024-04-26 at 2 23 01 PM