I recently wrote a small hack to enable writing Titanium apps with TypeScript (https://github.com/developer82/Ti.TypeScript). This involves editing the SDK alloy compiler script.
As you can tell from what I've written the script is located at /Users/YOUR_USERNAME/.appcelerator/install/SDK_VERSION/package/node_modules/alloy/Alloy/commands/compile/index.js
When I run my project from Titanium Studio it works great. However when I try to run from command line using ti build -p ios I'm getting an error This project requires the TypeScript hack in Titnaium SDK - which is a validation I wrote that the hack was applied to the compiler.
The reason for this is that running from command line, the CLI is looking for alloy in /usr/local/bin/alloy - I learned that from the following output:
[INFO] Executing Alloy compile: /usr/local/bin/node /usr/local/bin/alloy compile /Users/ophir/Documents/Appcelerator_Studio_Workspace/MY_PROJECT/app --config platform=ios,version=0,simtype=none,devicefamily=universal,deploytype=development,target=simulator
Why the different location? Why the CLI doesn't work like Appcelerator Studio? how can I make it work like Appc Studio?
Solution turned up to simpler than I thought... instead of using ti command I started using appc command:
appc run --platform iphone --liveview
I think ti is the open source version (which uses the alloy installed from node) and appc is the Appcelerator platform (that's what Appcelerator Studio runs).
Related
I have a problem completing NativeScript installation requirement. I got stuck at number 5 in the installation guide available here.
When i run the command "tns doctor" in the command prompt, i get the error message below:
Cannot find a compatible Android SDK for compilation. To be able to
build for An droid, install Android SDK 22 or later. Run $
%ANDROID_HOME%\tools\android to manage your Android SDK versions.
You need to have the Android SDK Build-tools installed on your system.
You can i nstall any version in the following range: '>=23 <=27'. Run
$ %ANDROID_HOME%\tools\android from your command-line to install
required An droid Build Tools.
You need to have Android SDK 22 or later and the latest Android
Support Reposito ry installed on your system. Run $
%ANDROID_HOME%\tools\android to manage the Android Support Repository.
I have installed the required sdk and i am still getting the same error message and every time i execute this script in the console, it takes like forever to complete:
"%ANDROID_HOME%\tools\bin\sdkmanager" "tools" "platform-tools"
"platforms;android-25" "build-tools;25.0.2"
"extras;android;m2repository" "extras;google;m2repository"
From the appcelerator studio I selected file -> new -> mobile app project.
The open dialog appears but does not display the option to create an alloy app.
These are the only options I can see in New mobile app project dialog box
Thanks in advance.
Seems Alloy was not installed in your system for any reason which is quite odd. But here you can install it using command-line/terminal by running this command :
sudo npm install -g alloy
After successfully installing Alloy, you can check for its version using below command:
appc -v mine is Alloy version 1.10.7
You can also check for Alloy installation in your Studio About section as shown in screenshot.
Select About Axway Appcelerator Studio -> Installation Details -> Plug-ins
I've got an Ionic 3.4 project and trying to build it to Android for testing purposes.
I installed Android Studio and the Android SDK, aswell Java 8. Then did:
ionic cordova platform add android
Then, when I write...
ionic build android
... I get the following error:
cordova build android ✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit
code 1):
ANDROID_HOME=C:\Users\Zerok\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_121
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
What's going on? I also installed Gradle 4.0 into the Java folder, and pointed towards it in the GRADLE_HOME environment variable:
Var name: GRADLE_HOME
Value: C:\Program Files\Java\gradle-4.0
Also added the following to the path:
GRADLE_HOME\bin
But it still throws the same error... I don't think it's a problem with plugins, but with the Ionic/Cordova build system. What I don't understand, is why it needs Gradle when it's perfectly working in Android Studio, maybe it's because it's not in C:/, but a different disk? Any ideas?
(Assuming Windows 10)
open Start Menu, type path and hit Enter
System Properties will open. On the bottom click Environment Variables...
In the window that opens, on the bottom section named System Variables, double click Path
Click New and copy paste the path to your gradle installation
Make sure the path environment variable points to the bin folder of gradle like so: export PATH="$PATH:/home/jeffbl/android-studio/gradle/gradle-3.2/bin".
If that doesn't work try:
$ cordova platform rm android && cordova platform add https://github.com/apache/cordova-android && cordova build
If that doesn't work then use the SDK manager to downgrade to an earlier version of your SDK. It might be that there is no graddle wrapper out yet for the latest.
In any case you will find the answer to your problem in this github issue.
Ok, I already fixed it. And the fix is weird as hell, but well, at least it works.
Solution: uninstall Android Studio and install it in the main drive (C in my case). Everything began to work perfectly after this clean install.
I have create a new Mobile Module Project, but when i try to build it, i have this error:
BUILD FAILED
C:\ProgramData\Titanium\mobilesdk\win32\5.2.2.GA\module\android\build.xml:165:
no executable specified
Did something wrong? I did the following step:
-Installed Appcelerator Studio
-It automatically installed Titanium SDK and i selected to install Android SDK
-Installed JAVA JDK
-Createed new module and tryed to build it
To fix this, edit the file:
C:\ProgramData\Titanium\mobilesdk\win32\5.2.2.GA\module\android\build.xml
Or for any newer SDK versions, just use e.g. 5.3.1 instead of 5.2.2
On line 159, add ".exe" to aidl, like so:
TO
To develop android module you will have to install some additional component and configure some path variables. There is a nice quick start guide where you will find everything. Thinks that need to install:
Android NDK
Ant
Eclipse Java Development Tools plugin
Android Development Tools plugin
gperf
Python
Documentation Link
I want to build a phonegap project (on windows 8.1) for windows 8 but somehow I get an error. Building a Android project goes without any errors. When I run the command 'phonegap run windows8' I get the following error:
I also tried 'phonegap install windows8', same problem. I installed phonegap last week using 'npm install -g phonegap'. Maybe a stupid question, but how do I know I use the latest release (currently 2.9.1)? When I do 'phonegap version' it returns 3.3.0-0.18.0.
I installed cordova instead of phonegap in my command-line (npm install cordova). with cordova everything went just fine. I searched in the platform list of the phonegap install and noticed phonegap doesn't support windows 8. Very confusing since the phonegap website tells us to install phonegap instead of cordova. If anyone has question about building a app phonegap for windows 8 let me know.