react-native-svg: Execution failed for task ':react-native-svg:compileDebugJavaWithJavac'.

Bug

I ran following comments for setup, npm i react-native-copilot npm i react-native-svg react-native link react-native-svg

everything fine, but I’m getting build time error.

Task :react-native-svg:compileDebugJavaWithJavac FAILED /Users/mahendran.m/workspace/ekart-stormtrooper/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableViewManager.java💯 error: cannot find symbol START, ^ symbol: variable START location: class RenderableViewManager.RenderableShadowNode /Users/mahendran.m/workspace/ekart-stormtrooper/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableViewManager.java:101: error: cannot find symbol END, ^ symbol: variable END location: class RenderableViewManager.RenderableShadowNode /Users/mahendran.m/workspace/ekart-stormtrooper/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableViewManager.java:119: error: cannot find symbol MARGIN_START, ^ symbol: variable MARGIN_START location: class RenderableViewManager.RenderableShadowNode /Users/mahendran.m/workspace/ekart-stormtrooper/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableViewManager.java:120: error: cannot find symbol MARGIN_END, ^ symbol: variable MARGIN_END location: class RenderableViewManager.RenderableShadowNode /Users/mahendran.m/workspace/ekart-stormtrooper/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableViewManager.java:130: error: cannot find symbol PADDING_START, ^ symbol: variable PADDING_START location: class RenderableViewManager.RenderableShadowNode /Users/mahendran.m/workspace/ekart-stormtrooper/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableViewManager.java:131: error: cannot find symbol PADDING_END, ^ symbol: variable PADDING_END location: class RenderableViewManager.RenderableShadowNode /Users/mahendran.m/workspace/ekart-stormtrooper/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableViewManager.java:134: error: cannot find symbol BORDER_START_WIDTH, ^ symbol: variable BORDER_START_WIDTH location: class RenderableViewManager.RenderableShadowNode /Users/mahendran.m/workspace/ekart-stormtrooper/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/RenderableViewManager.java:135: error: cannot find symbol BORDER_END_WIDTH, ^ symbol: variable BORDER_END_WIDTH location: class RenderableViewManager.RenderableShadowNode Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 8 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:react-native-svg:compileDebugJavaWithJavac’.

Compilation failed; see the compiler error output for details.

Environment info

info React Native Environment Info: System: OS: macOS 10.14.5 CPU: (8) x64 Intel® Core™ i7-4770HQ CPU @ 2.20GHz Memory: 25.87 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 8.9.4 - ~/.nvm/versions/node/v8.9.4/bin/node Yarn: 1.12.3 - /usr/local/bin/yarn npm: 5.6.0 - ~/.nvm/versions/node/v8.9.4/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: Android SDK: API Levels: 23, 24, 25, 26, 27, 28 Build Tools: 23.0.1, 23.0.2, 25.0.0, 25.0.1, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.1, 28.0.3 System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-24 | Google APIs ARM 64 v8a, android-28 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom IDEs: Android Studio: 3.3 AI-182.5107.16.33.5314842 Xcode: /undefined - /usr/bin/xcodebuild npmPackages: react: ^16.8.6 => 16.8.6 react-native: 0.59.9 => 0.59.9 npmGlobalPackages: react-native-cli: 2.0.1

Library version: ^9.5.1

Steps To Reproduce

  1. npm i react-native-copilot
  2. npm i react-native-svg
  3. react-native link react-native-svg
  4. react-native run-android

Describe what you expected to happen:

  1. successful build

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15

Most upvoted comments

this was my error …/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/PathParser.java:43: error: ‘;’ put a semicolon after break fixed it

Ok, I found it. It was a problem with my build.gradle. Obviously this is because I’m a) doing a big upgrade and b) don’t know what I’m doing!

diff --git a/android/build.gradle b/android/build.gradle
index 79f7a803..05d74d0a 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -34,9 +34,9 @@ wrapper {

 ext {
     minSdkVersion = 16
-    compileSdkVersion = 26
-    targetSdkVersion = 26
-    supportLibVersion = "26.1.0"
+    compileSdkVersion = 28
+    targetSdkVersion = 28
+    supportLibVersion = "28.0.0"
 }

 subprojects {
@@ -45,7 +45,7 @@ subprojects {
         resolutionStrategy.eachDependency { details ->
             if (details.requested.group == 'com.android.support'
                 && !details.requested.name.contains('multidex') ) {
-                details.useVersion "26.1.0"
+                details.useVersion "28.0.0"
             }
         }
     }

Did you get any where with this? isue #779 suggests it is fixed in v7.0.2 but I am experiencing with v9.7.1