kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
758 stars 238 forks source link

Imvaild symlink #825

Closed pythonsus closed 11 months ago

pythonsus commented 11 months ago

Versions

Describe the bug When running my app on xcode i am getting a invalid symlink at my python3 file

To Reproduce • install kivy-ios by development • toolchain build python3 kivy pillow numpy • toolchain pip install --no-deps kivymd • toolchain pip install pandas requests boto3 • toolchain create app appdir •remove libfreetype.a • open and then run xcode project

Expected behavior App to launch

Logs

Details

Simulator device returned an error for the requested operation.
Domain: IXUserPresentableErrorDomain
Code: 1
Failure Reason: Please try again later.
Recovery Suggestion: invalid symlink at /Users/suhaan/Library/Developer/CoreSimulator/Devices/C2B4BBCD-B7D8-4325-9BF0-B3394EF6A277/data/Library/Caches/com.apple.mobile.installd.staging/temp.NBFtoA/extracted/bestprice.app/YourApp/bin/python3
User Info: {
    DVTErrorCreationDateKey = "2023-07-12 19:09:25 +0000";
    IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
    SimCallingSelector = "installApplication:withOptions:error:";
}
--
Unable To Install “bestprice”
Domain: IXUserPresentableErrorDomain
Code: 1
Failure Reason: Please try again later.
Recovery Suggestion: invalid symlink at /Users/suhaan/Library/Developer/CoreSimulator/Devices/C2B4BBCD-B7D8-4325-9BF0-B3394EF6A277/data/Library/Caches/com.apple.mobile.installd.staging/temp.NBFtoA/extracted/bestprice.app/YourApp/bin/python3
--
invalid symlink at /Users/suhaan/Library/Developer/CoreSimulator/Devices/C2B4BBCD-B7D8-4325-9BF0-B3394EF6A277/data/Library/Caches/com.apple.mobile.installd.staging/temp.NBFtoA/extracted/bestprice.app/YourApp/bin/python3
Domain: MIInstallerErrorDomain
Code: 70
User Info: {
    FunctionName = "-[MIFileManager validateSymlinksInURLDoNotEscapeURL:error:]_block_invoke";
    LegacyErrorString = InvalidSymlink;
    SourceFileLine = 1073;
}
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone15,2";
    "device_osBuild" = "16.4 (20E247)";
    "device_platform" = "com.apple.platform.iphonesimulator";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 8573;
    "operation_errorCode" = 1;
    "operation_errorDomain" = IXUserPresentableErrorDomain;
    "operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher;
    "operation_name" = IDERunOperationWorkerGroup;
    "param_consoleMode" = 0;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 3;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.iphonesimulator";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_checker_tpc_enable" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 0;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphonesimulator16.4";
    "sdk_osVersion" = "16.4";
    "sdk_variant" = iphonesimulator;
}
--

System Information

macOS Version 13.4.1 (Build 22F82)
Xcode 14.3.1 (21815) (Build 14E300c)
Timestamp: 2023-07-12T15:09:25-04:00

Screenshots

Additional context

from kivymd.app import MDApp
from kivymd.uix.label import MDLabel
from kivymd.uix.screen import MDScreen
from kivy.uix.scrollview import ScrollView
from kivy.uix.image import AsyncImage
from kivymd.uix.textfield import MDTextField
from kivymd.uix.list import MDList,ThreeLineAvatarIconListItem,ThreeLineListItem,ThreeLineAvatarListItem, ImageLeftWidget
from kivymd.uix.button import MDRectangleFlatButton, MDIconButton
from func import walmart,wholefoods,target
import pandas as pd
import boto3
import numpy as np
import webbrowser
from kivy.uix.boxlayout import BoxLayout
from kivy.core.window import Window

        # it will open google window in your browser
# creating Demo Class(base class)
class BestPrice(MDApp):

    def build(self):
        self.screen = MDScreen()
        self.icon=' Screenshot 2023-07-06 at 3.30.19 PM-overlay.png'

        # defining label with all the parameters
        l = MDLabel(text="BestPrice",pos_hint={
                           'center_x': 0.8, 'center_y': 0.8},font_style='H3',
                    )

        # defining Text field with all the parameters
        self.nameitem = MDTextField(hint_text="Enter Your item", pos_hint={'center_x': 0.4, 'center_y': 0.7},size_hint_x=None, width=300,helper_text='Candy, Computers, Tents, Refrigator, etc.')

        sbtn=MDIconButton(
                    icon="search-web",
                    pos_hint={"center_x": 0.5, "center_y": 0.7},on_release=self.searchscrap
                )
        # adding widgets to screen
        self.screen.add_widget(self.nameitem)
        self.screen.add_widget(sbtn)
        self.screen.add_widget(l)
        # returning the screen
        return self.screen

    # defining a btnfun() for the button to
    # call when clicked on it
    def searchscrap(self, obj):
        print(self.nameitem.text)
        walmart(self.nameitem.text)
        target(self.nameitem.text)
        wholefoods(self.nameitem.text)
        data = {
            "": [None],

}
        try:
            df1 = pd.read_csv('walmart.csv')
        except:
            df1=pd.DataFrame(data)
            df1=df1.dropna()
        try:    
            df2 = pd.read_csv('wholefoods.csv')

        except:
            df2=pd.DataFrame(data)
            df2=df2.dropna()
        try:
            df3 = pd.read_csv('target.csv')
        except:
            df3=pd.DataFrame(data)
            df3=df3.dropna()

        combined_df = pd.concat([df1, df2, df3], axis=0)

        # Reset the index of the combined dataframe

        combined_df.reset_index(drop=True, inplace=True)
        import re
        print(combined_df['Price'])
        combined_df['Price'] = combined_df['Price'].astype(str)
        combined_df['Price'] = combined_df['Price'].str.replace(',', '')
        combined_df['Price'] = combined_df['Price'].apply(lambda x: float(re.findall(r'\d.*', x)[0]) if re.findall(r'\d.*', x) else None)

        # try:
        #     combined_df['Price'] = pd.to_numeric(combined_df['Price'].str.replace('Now ', ''))
        # except:
        #     pass
        combined_df.sort_values(by='Price', inplace=True)
        print(combined_df['Price'])
        # Save the combined dataframe to a new CSV file
        from io import StringIO
        combined_df.to_csv('result.csv', index=False)
        csv_buffer = StringIO()
        combined_df.to_csv(csv_buffer)
        bucket_name = 'foodsaverkivyapp'
        key = 'result.csv'

        s3 = boto3.client('s3', aws_access_key_id='AKIAREZ56TUXHUQASGOF',
                        aws_secret_access_key='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')
        s3.put_object(Body=csv_buffer.getvalue(), Bucket=bucket_name, Key=key)
        scroll = ScrollView(pos_hint={'x':0.55 })
        self.combined_df=combined_df
        list_view = MDList()
        print(np.shape(combined_df))
        for i in range(np.shape(combined_df)[0]):
            url=combined_df['Url'][i]

            items = ThreeLineAvatarIconListItem(text=combined_df['Title'][i],
                                     secondary_text=f"${combined_df['Price'][i]}",
                                     tertiary_text=f"{combined_df['Rating'][i]} Stars",pos_hint={'x':0.5 , 'y': 0.1})
            items.url = url
            #items.Imagelink=combined_df['Imagelink'][i]
            image_widget = ImageLeftWidget(source=combined_df['Imagelink'][i])

            # Add the image widget to the custom list item
            items.add_widget(image_widget)

            # Bind the on_release event to a callback function
            items.bind(on_release=self.on_item_release)

            list_view.add_widget(items)

        scroll.add_widget(list_view)

        # End List

        self.screen.add_widget(scroll)
    def on_item_release(self, instance):
        # Access the custom URL assigned to the item
        url = instance.url
        # Open the URL using appropriate methods (e.g., webbrowser.open)
        # For demonstration purposes, we'll just print the URL
        webbrowser.open_new_tab(url)
if __name__ == "__main__":
    BestPrice().run()
pythonsus commented 11 months ago

only use needed files