Is there a way to hide all .m files in the project navigator of an Xcode workspace? I can always get to them through their headers, so I would like not to have to look at both header and implementation in the project navigator.
Related
I would like to add the extern jar library commons-jexl-2.1.1.jar. I copied the jar into the libs/ folder and performed the Add as library... menu point. I don't receive any errors in the code and everything seems to work but when compiling and starting the application I receive the error java.lang.NoClassDefFoundError: org.apache.commons.jexl2.JexlEngineon this line private JexlEngine jexl = new JexlEngine();
Does anyone know what I've missed?
Unfortunately, that menu command is doing the wrong thing for Gradle-based projects, which I assume yours is. (Gradle-based projects are what you get when you create new projects in Android Studio). I've filed bug https://code.google.com/p/android/issues/detail?id=62249 to request implementing this menu command properly for these projects, or at a minimum disabling it until it's implemented to prevent confusion.
In the meantime, you can add external JAR dependencies by going through the Project Structure dialog, which will add the appropriate entries to your build.gradle build file. Choose File menu > Project Structure, and click on the "Modules" entry on the left. Choose your module from the middle list, and click on the Dependencies tab on the right. Then click on the + button at the bottom to add a new dependency. Screen shot here:
The + menu has an option for "File dependency" (pictured). You will get a file chooser that will let you select the jar file.
If your dependency is one that can be found in Maven, you may find it more convenient to specify the Maven coordinates; that way, the build system will automatically download the dependency, and you won't have to download and store the JAR manually. To set that up, choose "Maven dependency" from the + menu. You'll get a dialog where you can search to find the proper Maven coordinates for your library. In your case, those coordinates will be "org.apache.commons:commons-jexl:2.1.1#jar"
If you prefer to edit build files by hand, check out your build.gradle file after completing the Project Structure dialog changes to see what it did.
The docs for using Gradle in Android are at http://tools.android.com/tech-docs/new-build-system
courtesy The App Chaps
I've been struggling with the same thing for many hours, trying to get the Gson jar to work no less. I finally cracked it – here are the steps I took:
Put the Gson jar (in my case, gson-2.2.4.jar) into the libs folder
Right click it and hit 'Add as library'
Ensure that compile files('libs/gson-2.2.4.jar') is in your build.gradle file
Do a clean build (you can probably do this fine in Android Studio, but to make sure I navigated in a terminal to the root folder of my app and typed gradlew clean. I'm on Mac OS X, the command might be different on your system
After I did the above three, it started working fine. I think the 'Add as library' step was the one I'd previously missed, and it didn't work until I cleaned it either.
[Edit - added the build.gradle step which is also necessary as others have pointed out]
I'm using libgdx for a desktop game/prototype and I want to start getting into UI design.
I followed the answer here: Default Skin LibGDX? to download the necessary skin files but I'm not sure where in my project to put the ui directory with these files. I have tried to put it right in the project directory along side libs and src, so there's libs, src, ui, Referenced Libraries, and JRE System Library but when I reference the Skin with new Skin("ui/uiskin.json") it is throwing a filenotfound exception. Should this be down in my com. package in the project viewer in Eclipse?
I understand for an Android app you use the asset folder, but I don't have one in my project since it's a desktop app, even if I were to just add it.. I still don't know at which level unfortunately. This is probably really simple.
Thanks in advance.
The skin files are being looked up as "internal" files. On Android, this will look through the Android asset directory and CLASSPATH, but with the Desktop backend, only CLASSPATH will be searched.
To be consistent with the way things generally work in Libgdx, create a directory called assets next to the src and libs directories in your desktop project. Then put your ui directory inside assets. This isn't strictly necessary (see below) but will make your project a bit more compatible with other Libgdx code and projects. With an Android project the desktop assets directory is normally linked to the Android assets directory, but without an Android project you should create a regular directory.
If you used the Libgdx Libgdx "setup tool" the desktop project's assets directory should already be on the CLASSPATH. If not, you will also need to add this assets directory to your CLASSPATH: Right click on the project -> Properties -> Java Build Path -> Source tab -> Add Folder ... -> Select the assets directory.
To be clear, if you don't want to mirror the Libgdx conventions above, you just need to make sure the directory containing your skin files is on the CLASSPATH, then they will be found as "internal" Libgdx files (for example, you could add the ui directory directly to the CLASSPATH, and then look the files up without the explicit ui/ prefix).
I am using push notifications extension and getting an error :
ReferenceError: Error #1065: Variable
com.freshplanet.nativeExtensions::PushNotification is not defined.
These are the simple steps I followed so far:
1) added the extension in the properties/actionscript build path/native extensions . it is with a green flag and the .ane is located in my libs folder
2) added the extensionid to my app.xml file
<extensions>
<extensionID>com.freshplanet.AirPushNotification</extensionID>
</extensions>
3) registered in the app constructor :
PushNotification.getInstance().registerForPushNotification();
4)
Do the following steps, which use Flash Builder 4.5.1:
Change the filename extension of the ANE file from .ane to .swc. This step is necessary so that Flash Builder can find the file.
Select Project > Properties on your Flash Builder project.
Select the Flex Build Path in the Properties dialog box.
In the Library Path tab, select Add SWC....
Browse to the SWC file and select Open.
Select OK in the Add SWC... dialog box.
The ANE file now appears in the Library Path tab in the Properties dialog box.
Expand the SWC file entry. Double-click Link Type to open the Library Path Item Options dialog box.
In the Library Path Item Options dialog box, change the Link Type to External.
Now you can compile your application using, for example, Project > Build Project.
This is all done on iPad
Thanks for the help :-)
You don't need a native extension for this as it is part of AIR 3.4. See http://www.adobe.com/devnet/air/articles/ios-push-notifications.html for more information and a step-by-step guide on how to get it to work
Well the problem was resolved by opening the project properties panel , in the actionscript build packaging selecting Apple ios, there under the native extensions tab select package for all the extensions needed in the project.
The confusing part here for me was that there are 2 places than need to add the native extensions, one is the actionscript build path and the second is the actionscript build packaging.
The step of renaming the package to .swc and adding it to the build is not need from what I understand.
I just started using the ZXing SDK in my iPhone project. This requires that include it be renamed to .mm files (objective-c++).
The problem is that because of one file in my project xcode refactoring has been disabled for the entire thing.
Is there a work around to this issue? A way to refactor for everything except that file or a better way to include things? Possibly by making a static lib of third party code?
I can recreate the problem you're having by adding a C++ file to a Cocoa project. I was able to enable the refactoring menu items by selecting a different file in the project navigator and selecting some text. If that doesn't work, you could remove the one file from the project, do the refactoring, and add the file back to the project.
hi i hav tried to covert .mxlml to .swc file using flex builder
it's not working when i integrate with other application...can any one say how to get .swc using SDK...pls i need very clearly
In Flex Builder (Or Flash Builder) you need to create a Flex Library project. Put that mxml file in the library project, right click and select "include in library" from the context menu.
The Flex Library project should generate a SWC with that class which you can then use in other proejcts by adding that SWC to the library path.
Flextras is right, but a little more clearly (since you haven't accepted it yet):
Within Flex Builder (I'm assuming Flex Builder 3, but it's probably the same in Flash Builder), go to File -> New -> Flex Library Project. Enter a name an click Finish. This creates your project.
Create (or copy) the files you wish to compile into the src folder in your new project. The trick is that when you copy a file to the src, it is NOT automatically included in the library's build, and hence it will NOT end up compiled in the resulting SWC.
To include these files in the library build, right click on the project in the Navigator panel and select Properties. Click on "Flex Library Build Path" on the left, and under the "Classes" tab on the right, click "Select All" (or check the boxes you wish to include manually).
Once your files are included in the library project's build path, simply build the project. The build should happen automatically, but you can go to the Project menu and select "Clean" to be sure. Ensure that your project compiles correctly (no compile errors), and a SWC file should be generated in the bin folder. Note that pretty much whenever you change anything within the project's file structure, you will probably need to repeat the step of clicking "Select All" in the library build path.