Skip to content

Latest version of the Library has compilation issues #7635

@ivandortulov

Description

@ivandortulov

🐛 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.`

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

(Write your steps here:)

  1. Create a clean project using React Native CLI - npx react-native init Issue
  2. Install the react-native-navigation package with yarn - yarn add react-native-navigation
  3. Run npx rnn-link
  4. 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.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions