0
votes

When I initialize react-native, going to link gesture,i just show a problem, i dont know why,and i also has been fixed the MainActivity.java According to the https://reactnavigation.org/docs/en/getting-started.html

npm install --save react-navigation npm install --save react-native-gesture-handler

when i text react-native link react-native-gesture-handler just show the problem "rnpm-install ERR! ERRPACKAGEJSON No package found. Are you sure this is a React Native project? Package name not found in D:\egame_android\egame\android\app\src\debug\AndroidManifest.xml"enter image description here enter image description here

enter image description here

1

1 Answers

0
votes

Please go to "D:\egame_android\egame\android\app\src\debug\AndroidManifest.xml" and add package name attribute. Eg: package="com.YOUR_PACKAGE_NAME"

My AndroidManifest.xml after fix the issue:

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

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

    <application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
</manifest>