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

Android Error #17

Closed
skyride99 opened this issue Jan 28, 2016 · 10 comments
Closed

Android Error #17

skyride99 opened this issue Jan 28, 2016 · 10 comments

Comments

@skyride99
Copy link

Using RN 18.1, I get this error?

screen shot 2016-01-28 at 10 27 23 pm

@alvaromb
Copy link
Collaborator

Thanks for the bug report @skyride99! Will take a look :)

@alvaromb
Copy link
Collaborator

@skyride99
Copy link
Author

Its in package.json as 18.1 I did not update it. Just a regular react-native init.

I tried on RN 17 also same problem.

@skyride99
Copy link
Author

This works in iOS but not Android.

button tag swallowed by github
<Button
style={styles.greenButton} textStyle={styles.textStyle}
onPress={() => {
console.log('sign in!')
}}>
Sign in

@alvaromb
Copy link
Collaborator

@skyride99 which Android version are you running on? I think that this happens under 4.3 or lower.

@alvaromb
Copy link
Collaborator

Ok, got it, you have to use a device with Android API 21+: https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/TouchableNativeFeedback.android.js#L99-L100

Will change a few things to make the background prop optional.

alvaromb pushed a commit that referenced this issue Jan 29, 2016
The default TouchableNativeFeedback background prop is now supported by Android API versions older than 21 and it's customisable.
alvaromb added a commit that referenced this issue Jan 29, 2016
@alvaromb
Copy link
Collaborator

Solved in https://github.com/APSL/react-native-button/releases/tag/v2.4.1.

You'll see a warning, it's due to this react-native issue facebook/react-native@28c0240

Thanks!

@alvaromb
Copy link
Collaborator

alvaromb commented Feb 5, 2016

@bartonhammond you should update your fork with this version, fixes a problem with Android devices with API lower than 21.

@bartonhammond
Copy link

Thanks for thinking of me, but No bueno, running npm test

 FAIL  src/components/__tests__/FormButton-test.js 
● Runtime Error
TypeError: Cannot read property 'style' of undefined
    at Object.eval (/Users/barton/projects/MFV/snowflake/node_modules/apsl-react-native-button/Button.js:19:25)
    at Loader._execModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:206:17)
    at Loader.requireModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:760:14)
    at Loader.requireModuleOrMock (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:790:19)
    at Object.eval (/Users/barton/projects/MFV/snowflake/src/components/FormButton.js:22:12)
    at Loader._execModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:206:17)
    at Loader.requireModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:760:14)
    at Loader.requireModuleOrMock (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:790:19)
    at Object.eval (/Users/barton/projects/MFV/snowflake/src/components/__tests__/FormButton-test.js:27:16)
    at Loader._execModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:206:17)
    at Loader.requireModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:760:14)
    at jasmine1 (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/testRunners/jasmine/jasmine1.js:233:16)
    at /Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/TestRunner.js:261:14
 FAIL  src/components/__tests__/Header-test.js 

@alvaromb
Copy link
Collaborator

alvaromb commented Feb 6, 2016

This version has the same problem with the style prop in Jest @bartonhammond, but makes the component usable with Android devices using older API versions. Update your fork if you want support with older Android versions.

Enviado desde mi iPhone

El 6 feb 2016, a las 0:45, Barton Hammond [email protected] escribió:

Thanks for thinking of me, but No bueno, running npm test

FAIL src/components/tests/FormButton-test.js
● Runtime Error
TypeError: Cannot read property 'style' of undefined
at Object.eval (/Users/barton/projects/MFV/snowflake/node_modules/apsl-react-native-button/Button.js:19:25)
at Loader._execModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:206:17)
at Loader.requireModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:760:14)
at Loader.requireModuleOrMock (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:790:19)
at Object.eval (/Users/barton/projects/MFV/snowflake/src/components/FormButton.js:22:12)
at Loader._execModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:206:17)
at Loader.requireModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:760:14)
at Loader.requireModuleOrMock (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:790:19)
at Object.eval (/Users/barton/projects/MFV/snowflake/src/components/tests/FormButton-test.js:27:16)
at Loader._execModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:206:17)
at Loader.requireModule (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:760:14)
at jasmine1 (/Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/testRunners/jasmine/jasmine1.js:233:16)
at /Users/barton/projects/MFV/snowflake/node_modules/jest-cli/src/TestRunner.js:261:14
FAIL src/components/tests/Header-test.js

Reply to this email directly or view it on GitHub.

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

No branches or pull requests

3 participants