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

Not working in Sketch 3 #3

Open
mrrocks opened this issue Apr 22, 2014 · 18 comments
Open

Not working in Sketch 3 #3

mrrocks opened this issue Apr 22, 2014 · 18 comments

Comments

@mrrocks
Copy link

mrrocks commented Apr 22, 2014

Console throws this error every time I try to generate app:

22/04/2014 22:24:03.113 Sketch[66265]: Sketch-Scripting Error on Line 830 (/Users/fran/Library/Application Support/com.bohemiancoding.sketch3/Plugins/sketch-android-kit/generate_app.jstalk): *** -[__NSArrayM objectAtIndex:]: index 18446744073709551615 beyond bounds [0 .. 3]

@mrrocks mrrocks closed this as completed Apr 22, 2014
@mrrocks mrrocks reopened this Apr 22, 2014
@malkomalko
Copy link
Owner

just got sketch 3, I'll take a look

@caidentity
Copy link

This would be perfect! as seem to be getting the same error as well.

@malkomalko
Copy link
Owner

still digging in! hopefully will be able to figure this out shortly

@nanoxd
Copy link

nanoxd commented Sep 29, 2014

I just stumbled upon this plugin and couldn't get it to work in Sketch. Is there any update on this?

@malkomalko
Copy link
Owner

@nanoxd it is not dead I just haven't had the time to get back around to this. The 2.x -> 3.x change will require some work to get it working with 3.x.

@nikhil-pagalguy
Copy link

Hey @malkomalko , its great utility you have built but sadly it is not working in Sketch 3 (as thread says). Any possibility that you will be working on it soon? I am Android developer with design team working on Sketch and honestly it would be great plugin to work with..... Any reply?

@malkomalko
Copy link
Owner

@nikhil-pagalguy I just found more free time. I'll work on getting this working by early next week. Sound good?

@nikhil-pagalguy
Copy link

@malkomalko Thats just gr8... Just shout if I can be of any help.. (Its not like I know JS that well...:P).. I really appreciate the efforts man...!!

@malkomalko
Copy link
Owner

I got passed the issues, but now I'm running into another one... dealing with the Mac App Store sandboxing which makes it hard to read/write files outside of the installed directory.

bomberstudios/sketch-sandbox#1

One quick solution would be to write the files into that folder and just popup where the path is so you can copy and paste it.

@nikhil-pagalguy
Copy link

@malkomalko Ya. I think Apple will fix the issue in their next incremental update. Till then, if you have got the plugin working, can you push it? I have Mountain Lion as well on other machine where I can use it, if possible. Also, your second approach to write files in same folder is seems good enough right now. Let me know....

@malkomalko
Copy link
Owner

@nikhil-pagalguy I pushed master with a working V3 version. Please try your hand at it to see if it works for you.

@malkomalko
Copy link
Owner

Just pushed out a quick update so it will open the folder for you on completion which I think is much nicer.

@malkomalko
Copy link
Owner

You may need to tweak this template files as they are probably a bit old now, but it should hopefully make sense.

@nikhil-pagalguy
Copy link

@malkomalko Thanks a lot and now it works just awesome..I was wondering if its possible to add more templates with say textviews, linear layouts, list views, shapes etc so that it can appropriately pick up element? If there is any way for this, just let me know and I can make some templates...Actually, http://exportkit.com/ this one does it for Photoshop but not so efficient with resources....

@malkomalko
Copy link
Owner

@nikhil-pagalguy This is definitely something that is possible. As I'm not doing much Android development however, maybe somebody using this plugin who knows js/cocoa could try there hand at adding a few more options?

The project should be easy to read and figure out how to add new custom properties.

I think a few things that would be helpful:

  1. create a colors xml file with all the colors from sketch
  2. create a strings xml file with all the text strings from sketch
  3. create a new plugin option that allows you to click on a group to mark it as a different type of view
  4. add new templates to be generated based off the above

I'm going to be working on an iOS version of this plugin which should start down this path.

@prechtelm
Copy link

@malkomalko Found your plugin today and the idea is brilliant!!! But I tried it on Sketch 3.2.2 and it is not working, just nothing happens.

@malkomalko
Copy link
Owner

@prechtelm is there anyway you can take a look at the console to see if you're seeing any errors? I'll see if I can replicate it.

@prechtelm
Copy link

The same error appears with generate_app and menu:

22.12.14 20:00:08,456 generate_app (Sketch Plugin)[620]: TypeError: null is not an object (evaluating 'doc.fileURL().path').
Plugin “generate_app”, line 410.
» return String(str).replace(new RegExp('^' + characters + '+|' + characters + '+$', 'g'), ''); «
22.12.14 20:00:08,456 Sketch[620]: Exception: {
column = 21;
line = 410;
sourceURL = "/Users/XXX/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Sketch Android Kit/generate_app.sketchplugin";
}

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

6 participants