Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid package error building project in android #399

Closed
2 of 5 tasks
BatDroid opened this issue Apr 30, 2018 · 2 comments
Closed
2 of 5 tasks

invalid package error building project in android #399

BatDroid opened this issue Apr 30, 2018 · 2 comments

Comments

@BatDroid
Copy link

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

Output of node -v && npm -v && npm ls --prod --depth=0

v8.0.0
5.8.0
/Users/...
└── (empty)

Config:

Sentry.config('https://[email protected]/...', {
....
}).install()

I have following issue:

when i want to build the project by ./gradlew build it fails with exception

Steps to reproduce:

  • ./gradlew build

Actual result:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lint'.
> Lint found errors in the project; aborting build.

  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...

  The first 3 errors (out of 4) were:
  /Users/x/.gradle/caches/modules-2/files-2.1/io.sentry/sentry/1.6.1/59f1d2484fed6478bd454dbe2470b2015172c656/sentry-1.6.1.jar: Error: Invalid package reference in library; not included in Android: javax.naming. Referenced from io.sentry.config.JndiLookup. [InvalidPackage]
  /Users/x/.gradle/caches/modules-2/files-2.1/io.sentry/sentry/1.6.1/59f1d2484fed6478bd454dbe2470b2015172c656/sentry-1.6.1.jar: Error: Invalid package reference in library; not included in Android: javax.servlet.http. Referenced from io.sentry.event.helper.BasicRemoteAddressResolver. [InvalidPackage]
  /Users/x/.gradle/caches/modules-2/files-2.1/io.sentry/sentry/1.6.1/59f1d2484fed6478bd454dbe2470b2015172c656/sentry-1.6.1.jar: Error: Invalid package reference in library; not included in Android: javax.servlet. Referenced from io.sentry.servlet.SentryServletContainerInitializer. [InvalidPackage]

Expected result:
being built

@HazAT HazAT self-assigned this May 7, 2018
@kiruto
Copy link

kiruto commented May 23, 2018

May I confirm that it is an Android side problem?
You checked the "iOS" checkbox in description of this issue.
If so:

The three classes seemed to be used in servlet.
So you could disable this lint by using lint option:

  1. Create a file named XXX.xml.
<lint>
    <issue id="InvalidPackage">
        <ignore path="**/sentry*.jar"/>
    </issue>
</lint>
  1. Add rule in your gradle script
android {
    lintOptions {
        lintConfig file("path-to-lint.xml")
    }
}

Now you can build your project.

@HazAT
Copy link
Member

HazAT commented Sep 4, 2019

I am closing all old issues, please if this is still a problem feel free to revive it.
Also, consider moving to our new SDK @sentry/react-native if it still happens there please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants