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.

After rebuilding on v0.70.0 avatars from Google stopped loading

See original GitHub issue

Description

It worked on v0.68.2, but not work on v0.70.0

This is how it works:

<Image style={{ width: 50, height: 50 }} resizeMode={'cover'}
source={{ uri: 'https://reactnative.dev/img/tiny_logo.png' }} />

And that doesn’t work:

<Image style={{ width: 50, height: 50 }} resizeMode={'cover'}
source={{ uri: 'https://lh3.googleusercontent.com/a-/AFdZuco5YkhulxjXcpR-YXEIQZ8r2uc0Ti0di-Bb_fzP=s96-c', }} />

In search of a solution, I tried to use:

  • Avatar from ‘react-native-paper’
  • Image from react-native
  • Fresco
  • react-native-fast-image

All solutions failed. Any clue how to resolve this issue? Thanks!

Version

0.70.0

Output of npx react-native info

System: OS: Windows 10 10.0.19043 CPU: (12) x64 Intel® Core™ i7-9750H CPU @ 2.60GHz Memory: 958.02 MB / 7.82 GB Binaries: Node: 16.17.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD npm: 7.18.1 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio: Not Found Languages: Java: 1.8.0_292 npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.0 => 0.70.0 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

import { Image } from ‘react-native’ <Image style={{ width: 50, height: 50 }} source={{ uri: ‘https://lh3.googleusercontent.com/a-/AFdZuco5YkhulxjXcpR-YXEIQZ8r2uc0Ti0di-Bb_fzP=s96-c’, }} />

Snack, code example, screenshot, or link to a repository

`import React, { useState, useContext } from ‘react’; import { Pressable, View, StyleSheet, Text, Image } from ‘react-native’ import { Surface } from ‘react-native-paper’ import watermelonSync from ‘…/database/watermelonSync’ import UserGroups from ‘…/groups/userGroups’ import { dateToLocal } from ‘…/services’ import { Theme } from ‘…/contexts’ export default ({ user, startWordSelection }) => { const { getColor, currentTint } = useContext(Theme) const [isOpened, setOpened] = useState(false) const [wasSynced, setSynced] = useState(false)

const styles = StyleSheet.create({
    userLink: {
        color: getColor('p', [21, 9, 9]), fontSize: 17,
        paddingLeft: 14, // borderColor: colors.s[10], borderWidth: 1,
    },
    userLinkWrapper: {
        backgroundColor: getColor('p', [8, 27, 31]),
        borderColor: getColor('p', [11, 31, 33]), borderRadius: 11, borderWidth: 1,
        flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center',
        paddingVertical: 9, marginBottom: 14, marginHorizontal: '3%'
    }
})
return <><Pressable onPress={async () => {
    if (user._raw.id == global.deviceSettings.user_id) return //TODO проверить чтоб не себя //TODO ПРОВЕРИТЬ
    if (!wasSynced) watermelonSync(global.db, user)
    setSynced(true)
    setOpened(!isOpened)
}} >
    <Surface style={styles.userLinkWrapper} elevation={currentTint === 2 ? 1 : 5}>
        <Image source={{ uri: 'https://lh3.googleusercontent.com/a-/AFdZuco5YkhulxjXcpR-YXEIQZ8r2uc0Ti0di-Bb_fzP=s96-c', }} style={{ width: 50, height: 50 }} resizeMode={'cover'} />
        <Image source={{ uri: user._raw.photo }} style={{ width: 50, height: 50 }} resizeMode={'cover'} />
        <View style={{ flex: 2 }} >
            <Text style={styles.userLink}>{user.name}</Text>
            <Text style={{ fontSize: 11, paddingLeft: 14, color: getColor('p', [15, 11, 14]) }}>Слов {user._raw.has_words}</Text>
        </View>
        <View style={{
            flex: 1, marginRight: 10, //borderColor: colors.t[10], borderWidth: 1,
            height: '100%', alignItems: 'flex-end',
        }} >
            <DateField title='Визит' date={user.lastVisitAt} />
            <View style={{ flex: 1 }} />
            <DateField title='Присоединился' date={user.createdAt} />
        </View>
    </Surface></Pressable>
    {isOpened && <UserGroups userId={user._raw.id} startWordSelection={startWordSelection} />}
</>

} const DateField = ({ title, date }) => { const { getColor } = useContext(Theme) return <View style={{ flexDirection: ‘row’, bottom: 0, alignItems: ‘flex-end’, }}> <Text style={{ color: getColor(‘p’, [15, 14, 15]), fontSize: 10, textAlign: ‘right’, }}>{title} </Text> <Text style={{ color: getColor(‘p’, [18, 14, 15]), fontSize: 12, textAlign: ‘right’, alignItems: ‘flex-end’ }}>{dateToLocal(date)}</Text> </View> }`

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
marvanovcommented, Sep 21, 2022

I found a problem, it’s a sanctions against the country from which the avatars are not loaded. And when checing links to avatars in the browser, they were loaded from cash. My problem is that i live in country with bad politics. To get out of the situation, I will place a script in the backend that will download the avatars to the backend-server and upload them to the application from it Thanks all for participanting!

0reactions
umangloriacommented, Sep 20, 2022

I am also facing the same issue. however, I am still on 0.69.5, And I am trying to load images from google books urls. Edit: I am able to fix the issue, On debugging I found that the actual url that Image component is using is http so I manually replaced http with https and images are now loading fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

After rebuilding the application on react-native in 0.70.0 ...
I found a problem, it's a sanctions against the country from which the avatars are not loaded. And when checing links to avatars...
Read more >
7 Ways to Fix Google Chrome Not Loading Images - MakeUseOf
3. Check Chrome's Site Settings. We'll continue the troubleshooting process by taking a look at Chrome settings. If you see broken image icons, ......
Read more >
Fix Chrome if it crashes or won't open - Computer
First: Try these common Chrome crash fixes · Quit Chrome and reopen it: Windows: Press Ctrl + q. Mac: Press ⌘ + q....
Read more >
Gmail is not working? Check these fixes — Auslogics Blog
In most cases, Gmail starts to load properly after conducting the following steps: Restart your computer and check if that resolves the issue....
Read more >
How to Fix: Google Chrome Is Not Loading Google.Com After ...
Restoring Google's home page to your computer is usually simple in Chrome. ... The fact that you can no longer access Google.com after...
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