question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error com.horcrux.svg does not exist on Windows/Android

See original GitHub issue

Hi,

I’m trying to install the react-native-svg package but I have not been able to do it yet.

I followed the instructions in the Readme (npm install and link code), but I have the following error when I execute react-native run-android

C:\rnative-projects\memoshape\android\app\src\main\java\com\memoshape\MainApplication.java:7: error: package com.horcrux.svg does not exist
import com.horcrux.svg.RNSvgPackage;
                      ^
C:\rnative-projects\memoshape\android\app\src\main\java\com\memoshape\MainApplication.java:29: error: cannot find symbol
            new RNSvgPackage()
                ^
  symbol: class RNSvgPackage
2 errors
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> 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.

BUILD FAILED

I´m developing with Windows 10.

and…

"dependencies": {
    "react": "15.4.1",
    "react-native": "0.39.2",
    "react-native-svg": "^4.4.1"
  }

Thank you for your help!

Edit:

Same problem with

"dependencies": {
    "react": "15.4.0",
    "react-native": "0.38",
    "react-native-svg": "4.4.0"
  }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:16

github_iconTop GitHub Comments

26reactions
seacloud9commented, Jan 9, 2017

@joncursi try:

import com.horcrux.svg.SvgPackage;

and

 return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new SvgPackage()
            new ReactNativeConfigPackage()
      );```

looks like they changed the name.
26reactions
mihabencommented, Jan 3, 2017

I found the problem, the installer was not adding the depedence in build.gradle, to fix the problem I added the compile code inside dependences{}, I also excluded the appcompat-v7 to avoid conflicts:

dependencies {
    compile(project(':react-native-svg')) {
        exclude group: "com.android.support", module: "appcompat-v7"
    }
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error com.horcrux.svg does not exist on Windows/Android #211
Hi, I'm trying to install the react-native-svg package but I have not been able to do it yet. I followed the instructions in...
Read more >
React-native: RNSvgPackage() error - Stack Overflow
React-native: RNSvgPackage() error​​ So I'm getting an error (at the bottom) that's most likely caused by me trying uninstalling react-native- ...
Read more >
react-native-svg - npm
react-native-svg provides SVG support to React Native on iOS, Android, macOS, Windows, and a compatibility layer for the web.
Read more >
com.horcrux.svg.SvgView.java Source code - Java2s.com
This source code is licensed under the MIT-style license found in the * LICENSE file in the root directory of this source tree....
Read more >
How to import SVG files in React Native using react-native-svg
In this tutorial, we won't focus on the SVG itself. ... This is because there isn't a built-in React Native component that can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found