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.
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 looking at Flash Builder for my next project. I'm following some tutorials, yet I keep getting stuck at the same part. The tutorials I am following tell me to add a SWC files (containing my art) and should be in a library project.
I can create the library project and use it as a reference in my application. However, when I try to add the SWC file to the "Flex Library Build Path" the OK button does nothing. The same happens if I try to add a SWC or SWC Folder.
I' m using Flash Builder 4.6 (trial version) if that makes any difference. Below is a screenshot of the window that I am talking about in case I'm not very clear.
It has also happened to me.
There is workaround - just place SWC into /libs directory of your project and perform clean. SWCs there will be loaded automatically.
Make sure you have added the folder to the Workspace's linked resources. In Flash Builder, go to menu Windows > Preferences > General > Workspace > Linked Resources, and add a new path variable to the component directory. After this, the component can be added to the project's Flex Library path.
I think this is a bug of flash builder. It has also happened to me. And I can not choose the output path in fb....
I found a way, first, delete this project, delete evrey thing fb created itself except the source code, then u can swith ur fb to a new workspace, add creat a new project, u will see that u can add the swc file now.finally,switch back to the workspace u worked with before......
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.
i have a Air Project in which i have added three extenal source folders.
but when i reopen project or strat flash builder again i get icon on those folder like this
but when i open the configuration for that project and try to validate the path and adding it again i get message like this
but the path is valid. proof is this pic
what could be possible error,,, is there any way that i when ever re-open project i get no warning and able to navigate through the linked source code. now i am doing it
1- deleting on of the linked folder
2- again adding that folder.
as for quick:
install flas builder 4.1
2.imort that project into workspace
3rd is using maven ;)
check your project files,
.actionScriptProperties
.flexProperties
.project
make all of them writeable. this issue occur when you get code from Visual Source Safe that the files are copied to local machine in read-only mode.
I have a swc(degrafa) that I have been referencing externally in another folder on my computer. When I tried to move the swc to the libs folder I was no longer able to access the swc from my application. Is there a step im missing?
Did you updated your library path as described here?
With a project selected in the Flex Navigator view, select Project > Properties > Flex Build Path.
Click on the Library Path tab, and then select and expand the SWC file entry to display the SWC options.
Double-click the Link Type option. The Library Path Items Options dialog box appears.
Select the Merged into Code option, and click OK.
This procedure is the equivalent of using the library-path compiler option.
The project libs folder was not the same as the one in the project tree. This was due to the project i am working on being apart of a larger project and the project properties was referencing the wrong folder. After changing the libs folder to the one I wanted to use the swc was recognized.