No suitable URL request handler found for ph-upload://

Please provide the following:

  1. SDK Version: 43.0.0
  2. Platforms(Android/iOS/web/all): Android/iOS
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

After upgrade Expo SDK version from 41.0.0 to 43.0.0 I got a problem with uploading images to server. Error description for IOS: No suitable URL request handler found for ph-upload://A354049E-57C1-4478-B5C0-1DF56886F1AD .
Error description for Android: [Unhandled promise rejection: TypeError: Network request failed] at node_modules/whatwg-fetch/dist/fetch.umd.js:535:17 in setTimeout$argument_0
What I have noticed is that in error description I see ph-upload:// but if I log my photo it contains this: "uri":"ph://A354049E-57C1-4478-B5C0-1DF56886F1AD","name":"IMG_3702.JPG","type":"photo" . The difference is ph-upload:// and ph:// . But after some research I found out that when you upload images to server this ph:// automatically changes to ph-upload:// so now I’m at a dead end.

[image]

This is my code:

const onSubmitPress = async () => {
        await setLoadingIndicator(true);
        let formData = new FormData();

        formData.append('title', textTitle);
        formData.append('description', textDescription);
        formData.append('latitude', latitude);
        formData.append('longitude', longitude);
        formData.append('photoAuthor', photoAuthor);
        formData.append('textAuthor', textAuthor);
        formData.append('landscapeType', landscapeType);
        formData.append('region', region);
        route.params?.data?.map((image, index) =>
        formData.append(`photo[]`, {
                uri: image.uri,
                name: image.filename,
                type: image.mediaType,
            }));
        route.params.data = undefined;
        const jwtToken = await SecureStore.getItemAsync('JWT');
        let responseTypes = await fetch('https://beautiful-places.ru/api/upload_place', {
            method: 'POST',
            headers: {
                'Content-Type': 'multipart/form-data;',
                'API-Access-Key': '******',
                'Authorization': 'Bearer ' + jwtToken
            },
            body: formData
        })
}

Before upgrade everything worked as expected.

Still can’t resolve this problem, so I returned to SDK version 41.0.0 and than upgraded it to 42.0.0 everything works fine, but when I upgraded from sdk 42.0.0 to 43.0.0 I got a problem again.

I’m, also found out that with expo 42.0.0 where uploading works in log I see this: {"uri":"assets-library://asset/asset.PNG?id=1A1A7BC6-3F07-46B7-8375-AED4D2C26DAB&ext=PNG","name":"IMG_3718.PNG","type":"photo"} so instead of ph:// it uses assets-library:// in iOS

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.