Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

error: method does not override or implement a method from a supertype #3

Open
romandubrov opened this issue Dec 7, 2017 · 2 comments

Comments

@romandubrov
Copy link

I'm getting this error when compiling Android build:

...\node_modules\tipsi-dash-line\android\src\main\java\com\tipsi\dashline\DashLineComponentReactPackage.java:22: error: method does not override or implement a method from a supertype
@OverRide
^
1 error
:tipsi-dash-line:compileReleaseJavaWithJavac FAILED

My RN version is:
"react-native": "^0.50.3",

@isnifer
Copy link

isnifer commented Dec 7, 2017

@romandubrov try to set in package.json:

"tipsi-dash-line": "tipsi/tipsi-dash-line#b7918dd"

instead of 0.1.0 to check that everything works

@romandubrov
Copy link
Author

@isnifer tried that. it helped with build, but when I've tried to run example code, I've got the following instead:

undefined is not an object (evaluating '_react2.PropTypes.string')

D:\111\tipsitest\node_modules\tipsi-dash-line\src\DashLine.js:7:25
...

I've looked into that file and noticed that PropTypes are imported from 'react', but in recent react they are moved to separate package named 'prop-types'. So I've installed prop-types and changed imports to be the following:

import React, { Component } from 'react'
import PropTypes from 'prop-types'

and got this:

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.

Check the render method of example.

This error is located at:
in RCTView (at View.js:112)
in View (at App.js:11)
...

the reason was wrong import specification in example code:
import { DashLine } from 'tipsi-dash-line'
it should be like this:
import DashLine from 'tipsi-dash-line'
as DashLine is a default export

after all this changes I've finally got a blank screen. Tried to surround Dashline with some Texts - I see the text, but there is no dash line.

after that I've added style={{height: 1}} to DashLine and it finally shown me some dash line

But when I've added a few dash lines in a row, I've noticed that they are slightly different in respect to height:

image

the code is:

      <View style={styles.container}>
        <Text>Before</Text>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <DashLine dashColor="#ff0000" dashLineWidth={3} dashLineSpace={3} style={{height: 1, marginBottom: 10, marginLeft: 10, marginRight: 10}}/>
        <Text>After</Text>
      </View>

I'm using Android 6.0 on XHDPI Phone emulator

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

No branches or pull requests

2 participants