🐛 Bug Report
I keep getting a bunch of package android.xx not found errors when I try to run my React Native App.
Here is the error log:
node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\NavigationActivity.java:3: error: package android.annotation does not exist
import android.annotation.TargetApi;
^
node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\NavigationActivity.java:4: error: package android.content does not exist
import android.content.Intent;
^
node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\NavigationActivity.java:5: error: package android.content.res does not exist
import android.content.res.Configuration;
^
node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\NavigationActivity.java:6: error: package android.graphics does not exist
import android.graphics.Color;
^
node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\NavigationActivity.java:7: error: package android.os does not exist
import android.os.Build;
^
node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\NavigationActivity.java:8: error: package android.os does not exist
import android.os.Bundle;
^
node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\NavigationActivity.java:9: error: package android.view does not exist
import android.view.KeyEvent;
^
node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\NavigationActivity.java:10: error: package android.view does not exist
import android.view.View;
^
node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\NavigationActivity.java:29: error: cannot access ViewGroup
public class NavigationActivity extends AppCompatActivity implements DefaultHardwareBackBtnHandler, PermissionAwareActivity, JsDevReloadHandler.ReloadListener {
^
class file for android.view.ViewGroup not found
9 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-navigation:compileReactNative63DebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 17s
at makeError (node_modules\execa\index.js:174:9)
at node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.`
Yes
To Reproduce
(Write your steps here:)
- Create a clean project using React Native CLI -
npx react-native init Issue
- Install the react-native-navigation package with yarn -
yarn add react-native-navigation
- Run
npx rnn-link
- Start the application using
npx react-native run-android
Expected behavior
I expected the application to compile and run.
Actual Behavior
Multiple compilation errors.
Your Environment
- React Native Navigation version: 7.30.1
- React Native version: 0.64.2
- Platform(s) (iOS, Android, or both?): Android
- Device info (Simulator/Device? OS version? Debug/Release?): Simulator, Android 11, Debug
Reproducible Demo
N/A
Are you willing to resolve this issue by submitting a Pull Request?
- ✖️ Yes, I have the time, and I know how to start.
- ✅ Yes, I have the time, but I don't know how to start. I would need guidance.
- ✖️ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
🐛 Bug Report
I keep getting a bunch of
package android.xx not founderrors when I try to run my React Native App.Here is the error log:
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
(Write your steps here:)
npx react-native init Issueyarn add react-native-navigationnpx rnn-linknpx react-native run-androidExpected behavior
I expected the application to compile and run.
Actual Behavior
Multiple compilation errors.
Your Environment
Reproducible Demo
N/A
Are you willing to resolve this issue by submitting a Pull Request?