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

The application does not compile on an ios device #564

Closed
NikitaAkimov opened this issue Nov 5, 2020 · 8 comments
Closed

The application does not compile on an ios device #564

NikitaAkimov opened this issue Nov 5, 2020 · 8 comments
Labels

Comments

@NikitaAkimov
Copy link

Versions

  • Python : 3.7
  • MacOS version : 10.15.7
  • XCode Version : 12.1 (12A7403)
  • Cython version : 0.29.21

Describe the bug
Hello, could you help me solve the problem associated with compiling the application on the iPhone.
An error occurs during compilation:
Снимок экрана 2020-11-05 в 21 59 58
Снимок экрана 2020-11-05 в 22 00 14

Although there is no such error when compiling on a simulator.

To Reproduce
Creation of xcode project was done using this video - https://www.youtube.com/watch?v=UAi3PG-qN2k&t=2s

Logs

Details

The file “testhelloapp” couldn’t be opened because you don’t have permission to view it.
Domain: NSCocoaErrorDomain
Code: 257
Failure Reason: You don’t have permission.
Recovery Suggestion: To view or change permissions, select the item in the Finder and choose File > Get Info.
User Info: {
    NSFilePath = "/Users/nikitaakimov/Library/Developer/Xcode/DerivedData/testhelloapp-eetjdazssegzfxbhqdbbpgjkgwzl/Build/Products/Debug-iphoneos/testhelloapp.app";
}
--
The operation couldn’t be completed. Permission denied
Domain: NSPOSIXErrorDomain
Code: 13
Failure Reason: Permission denied
--


System Information

macOS Version 10.15.7 (Build 19H2)
Xcode 12.1 (17222)
@Cheaterman
Copy link
Contributor

Dunno about the permission error you're getting, but building on Xcode 12 is unlikely to work yet, and believe me, I worked hard on it...

@NikitaAkimov
Copy link
Author

Dunno about the permission error you're getting, but building on Xcode 12 is unlikely to work yet, and believe me, I worked hard on it...

I managed to build the application I got it right on the simulator iOS. But when I try to build on iPhone this error appears.

@Cheaterman
Copy link
Contributor

Cheaterman commented Nov 6, 2020

I might be hitting this issue as well - my application works in simulator but not on actual device, couldn't get logs yet so I'm not sure. Nonetheless, building a kivy-ios dist from scratch with Xcode 12 tools failed for me ; did you build your kivy-ios dist prior to the Xcode 12 upgrade? (this is known to work at least for simulator and is in fact my current setup IIRC)
I can't help you yet (given I don't have the device and am not sure I'm hitting the same issue) but I'll potentially be able to investigate in the future.

@NikitaAkimov
Copy link
Author

I might be hitting this issue as well - my application works in simulator but not on actual device, couldn't get logs yet so I'm not sure. Nonetheless, building a kivy-ios dist from scratch with Xcode 12 tools failed for me ; did you build your kivy-ios dist prior to the Xcode 12 upgrade? (this is known to work at least for simulator and is in fact my current setup IIRC)
I can't help you yet (given I don't have the device and am not sure I'm hitting the same issue) but I'll potentially be able to investigate in the future.

I would be very grateful to you if you can find out what is the reason for this error.

@jda5
Copy link

jda5 commented Nov 17, 2020

I am having the exact same issue, and have been for some time!

At first I was running Xcode 12.2 on Catalina. Then I upgraded to Big Sur - same issue. Then I downgraded back to Catalina (clean build), reinstalled brew and installed Xcode 11.7, and am still producing the same issue!

I have tried adding "-O --no-perms" to the build phases. I have also disabled the arm64 architecture. I have made sure that every single file in my Library/Developer folder has Read & Write permission for everyone, and have done the same for the Kivy-ios files. I have also tried virtually everything suggested in: https://stackoverflow.com/questions/24924809/the-file-myapp-app-couldnt-be-opened-because-you-dont-have-permission-to-vi?page=1&tab=votes#tab-top

The only possible explanation I could think of is that it has something to do with my iPad running iOS 14.2, but I am too inexperienced to know what is really going on here.

@misl6
Copy link
Member

misl6 commented Dec 6, 2020

For the Xcode 12.2 related issue I have a pending PR that could be merged ASAP (when it passes the automated tests).
But unlikely this issue is linked to an issue with Xcode 12.2. @NikitaAkimov can you repeat the whole thing by following the instructions in README and avoiding sudo at all costs?

@PeanutTheAdmin
Copy link

I am having the exact same issue, and have been for some time!

At first I was running Xcode 12.2 on Catalina. Then I upgraded to Big Sur - same issue. Then I downgraded back to Catalina (clean build), reinstalled brew and installed Xcode 11.7, and am still producing the same issue!

I have tried adding "-O --no-perms" to the build phases. I have also disabled the arm64 architecture. I have made sure that every single file in my Library/Developer folder has Read & Write permission for everyone, and have done the same for the Kivy-ios files. I have also tried virtually everything suggested in: https://stackoverflow.com/questions/24924809/the-file-myapp-app-couldnt-be-opened-because-you-dont-have-permission-to-vi?page=1&tab=votes#tab-top

The only possible explanation I could think of is that it has something to do with my iPad running iOS 14.2, but I am too inexperienced to know what is really going on here.

I too had this same issue when trying to run my app on my iPhone.

Versions:
Python: 3.8.6
Mac OS: 10.15.7
Xcode: 12.3
Cython: 0.29.21

The app would run in a simulator but not on my physical iPhone.
So I deleted my project folder and started over.

I took misl6's advice and followed the instructions in the README file.
I followed the instructions and finally got it to work.

Here is what I did, and I will try to cover most of my steps as a simple follow along below that works as of for now. This is so you can do a simple Kivy test app before trying to do your own heavy intensive Kivy project. Just to get a feel for the process.

  1. Open the terminal and create a new folder to work with "mkdir KivyFirstApp"
  2. Use "cd KivyFirstApp" to change to that folder directory.
  3. While in terminal within the folder "KivyFirstApp" I created a virtual environment using "python3 -m venv env"
  4. Go ahead and activate the virtual environment inside the terminal by running "source env/bin/activate"
  5. While still in the terminal within the folder directory "KivyFirstApp" I cloned this hello world repo as a test app, just run "git clone https://github.com/Dirk-Sandberg/KivyHelloWorld.git"
  6. Just a quick check -- If you have followed these steps then if you run "ls" in the terminal you should have two folders "env" and "KivyHelloWorld". If you do not have these check the steps and start over again.
  7. Now you need to get the Kivy-ios by running "pip3 install kivy-ios"
  8. You will now need to build kivy-ios by running "toolchain build kivy" This will take a while!
  9. Next run "toolchain create helloworld ~/KivyFirstApp/KivyHelloWorld/" this will create a folder inside your "KivyFirstApp" directory called "helloworld-ios". You can check that a folder has been made by running "ls" and seeing "helloworld-ios" is listed.
  10. Now run "open ." yes there is a space and decimal after the word "open". This will open finder in the current terminal directory which should be the directory "KivyFirstApp".
  11. After finder opens in the "KivyFirstApp" directory you want to right click on "helloworld-ios", then click on "Get Info".
  12. In this new Finder window that has opened "helloworld-ios Info" your going to be doing changes at the bottom of this window. You want to click on the "Read only" under the privileges and change this to "Read & Write", make sure todo this for all that are listed. Then you want to click on the locked looking icon in the bottom right of the same window and it will prompt you for your password. After you type in your password, you want to click on the gear icon that is located at the bottom of the same window to the far left of the now unlocked icon. In that drop down menu click "apply to enclosed items...". Then Select "OK" on the popup. Go ahead and click on the unlocked icon to change it back to the locked icon.
  13. The only window that you now need open is your original terminal window so go ahead and exit out of the Finder "helloworld-ios Info" and the Finder "KivyFirstApp".
  14. Now inside your terminal window run "open helloworld-ios/helloworld.xcodeproj" This will then open your project in Xcode
  15. Now in the new Xcode window click on "helloworld" in the far left side towards the top of the screen.
  16. Click on "Signing & Capabilities" it is located beside General near the top-middle of the screen.
  17. In the middle of the screen click the drop down menu beside "Team" and select your Team Member. Mine Says "Jacob Cavaness (Personal Team)". Yours will be your first and last name followed with (Personal Team).
  18. In the middle of the screen on "bundle identifier" below "Team" change your bundle identifier to something other than the default"org.kivy.helloworld". I changed mine to "com.jacobcavaness.helloworld" because Jacob Cavaness is my name. Just use your first and last name like I did mine.
  19. Next Click at the top of the screen, to the right of the play and pause button to select your physical iPhone that is plugged into the Mac that you want to run your app on.
  20. Then hit the big play button at the very top and towards the left of the screen. If all goes as planned it should open this simple hello world button app on your phone.

Hopefully this helps you not only get some experience but also with your own projects.

@misl6
Copy link
Member

misl6 commented Mar 27, 2021

Thanks @PeanutTheAdmin for reporting your whole process. Maybe someone else could take advantage on it.

BTW, @NikitaAkimov I'm closing due to inactivity, feel free to re-open if it still needed.

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

No branches or pull requests

5 participants