I am starting Android development in Ruby using Rhomobile framework. I am trying to run rake command for android
rake run:android
but I'm getting following error
ERROR!!! API version is not found in installed Android SDK: 2.1
any hint on how to solve it?
also my rhobuild.yml files looks like
env:
app: /Users/bhushan/rhodes_learn/employee_app
paths:
android-ndk: /Users/bhushan/android-ndk-r7
java: /Library/Java/Home/bin
android: /Users/bhushan/android-sdk-macosx
4.6:
jde:
sim: 9000
mds:
cabwiz:
4.2:
jde:
sim: 8100
mds:
excludedirs:
bb:
- public/js/iui
- public/js/jquery*
- public/jqtouch*
- public/js/prototype*
- public/css/iphone*
- public/iwebkit
- public/themes
- "**/jquery*.js"
- "**/*.db"
- public/images/android
- public/images/iphone
all:
- "**/.*.swo"
- "**/.*.swn"
- "**/.DS_Store"
android:
build:
symbianpath: platform/symbian
bb:
bbsignpwd: somepasswordhere
bbpath: platform/bb
wmpath: platform/wm
androidpath: platform/android
wppath: platform/wp7
iphonepath: platform/iphone
Is the actual Android SDK Platform 2.1 installed? You should be able to check it from the SDK Manager tool that came with the Android SDK.
Also, if you've recently updated Rhodes (to 3.3.1, for example) you may need to re-run rhodes-setup and set-rhodes-sdk to update the locations of the tools
HTH,
I had to change the specified Version number in Rhodes Config file.
Related
I have managed to connect a device ( I see logs and see the tree of React Native elements), but now I have an issue with connecting the app - "NO APPLICATION SELECTED" is what I see. Any ideas to fix it?
Ran into the same problem on both iOS and Android with Flipper 0.135.0. Managed to make both work by following the steps below.
iOS
This answer solved the issue for me.
tl;dr
brew update && brew upgrade idb-companion
Also make sure you are installing the correct Cocoapod of Flipper by specifying the exact version in your Podfile with (for version 0.135.0)
use_flipper!({ 'Flipper'=> '0.135.0' })
Android
Ensure that ReactNativeFlipper.java is in the correct folder, as in this example project.
With for example the applicationId com.domain.appName, the correct path is
android/app/src/debug/java/com/domain/appName/ReactNativeFlipper.java
In my project this Java file was in the incorrect folder, which resulted in the Logcat error
java.lang.ClassNotFoundException: com.domain.appName.ReactNativeFlipper
Ensure that you are running the latest version of Flipper (0.120.0 as of this message) and then:
For Android:
Bump the FLIPPER_VERSION variable in android/gradle.properties, for example: FLIPPER_VERSION=0.120.0.
Run ./gradlew clean in the android directory.
For iOS:
Call use_flipper with a specific version in ios/Podfile, for example: use_flipper!({ 'Flipper' => '0.120.0' }).
Run pod install in the ios directory.
Reference: https://fbflipper.com/docs/getting-started/react-native/#using-the-latest-flipper-sdk
Go to settings and check if the path for your Sdk is correct
In my case issue was with the Emulator OS and API.
I used following combination and it worked:
Device: Pixel 4a
OS: Android 12
API: (Release Name: S, API level: 31, ABI: arm64-v8a, Target: Android 12
I also faced this issue, I was not seeing android simulator and the app to select, but it was working fine for iOS without any config.
The problem with my setup was that in the Flipper settings, the android SDK's path was not correct, after updating the path and restarting Flipper, it automatically detected the simulator and the app.
Hope this helps.
I was able to solve that on Android, open ReactNativeFlipper.java file
In the first line package com.yourappname; change it to exactly your package name inside AndroidManifest.xml
In the MainApplication.java there is a line like
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
inside onCreate() function. In my project this line was commented. I removed the comment and run react-native run-android and flipper get connected to the app
I have installed fresh appcelerator studio and titanium CLI and also other dependancies when I am trying to run android app then it showing the following error :
[INFO] : Packaging application: ../sw/android-sdk-macosx/build-tools/24.0.2/aapt "package" "-f" "-m" "-J" "WorkData/Appcelator Projects/test/build/android/gen" "-M" "../Appcelator Projects/test/build/android/AndroidManifest.xml" "-A" "../WorkData/Appcelator Projects/test/build/android/bin/assets" "-S" "../WorkData/Appcelator Projects/test/build/android/res" "-I" "../sw/android-sdk-macosx/platforms/android-23/android.jar" "-F" "../WorkData/Appcelator Projects/test/build/android/bin/app.ap_" "--auto-add-overlay" "--extra-packages" "ti.modules.titanium.ui:android.support.v7.appcompat:android.support.v7.cardview" "-S" "/var/folders/jf/f17wzygx4nbd6fg5wsntf4840000gn/T/116820-1742-1nuy1sx.xxrqp30udi/res" "-S" "/var/folders/jf/f17wzygx4nbd6fg5wsntf4840000gn/T/116820-1742-hop1bc.t53b359udi/res" "-S" "/var/folders/jf/f17wzygx4nbd6fg5wsntf4840000gn/T/116820-1742-6n4mu0.4svn3o9a4i/res"
2016-09-20T06:14:33.921Z | ERROR | An uncaught exception was thrown!
Path must be a string. Received undefined
2016-09-20T06:14:33.922Z | ERROR | Path must be a string. Received undefined
and also I am able to run same project on iPhone.
My machine Configuration is as follows :
Operating System
Name = Mac OS X
Version = 10.11.6
Architecture = 64bit
# CPUs = 4
Memory = 8589934592
Node.js
Node.js Version = 6.5.0
npm Version = 3.10.3
Titanium CLI
CLI Version = 5.0.9
Titanium SDK
SDK Version = 5.5.0.GA
SDK Path = /Users/neosoft/Library/Application Support/Titanium/mobilesdk/osx/5.5.0.GA
Target Platform = android
Command
can anyone help me to resolve issue ...
You appear to be using Build Tools SDK 24.#. This is not yet supported by Appcelerator. You should un-install this version and install 23 (the latest supported by appcelerator).
I recommend watching the Compatibility Matrix from time to time.
After that select the minSDK and targetSDK in Tiapp.xml like this:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest android:versionCode="1"
android:versionName="1.0.0" package="app.my" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="16" targetSdkVersion="23"/>
</manifest>
</android>
See my Android SDK folder looks like this:
Try to look at your Android SDK folders and check if there is anything related to version 24. And also do these tasks after deleting everything related to 24 version:
Remove the uses-sdk tag from tiapp.xml and let Titanium SDK do stuffs on its own.
Delete build and Resources folders from your Titanium project root directory
Clean and run the project now.
Check your version of node.js with this command:
node -v
If your version is higher than 4.4.2 that's the problem. You can fix it with:
sudo npm cache clean -f
sudo npm install -g n
sudo n 4.4.2
I had the same issue and got resolved after changing my node version to 4.4.2. Just updating it here if that may help anyone.
I am trying to use Apache Cordova for Android apps.
I had installed it with npm, but when I type the command cordova platforms add android, I have this error:
npm http GET https://registry.npmjs.org/cordova-android/4.0.0
TypeError: Request path contains unescaped characters.
at new ClientRequest (_http_client.js:73:11)
at TunnelingAgent.exports.request (http.js:49:10)
at TunnelingAgent.createSocket (C:\Users\Friend\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:117:25)
at TunnelingAgent.createSecureSocket [as createSocket] (C:\Users\Friend\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:184:41)
at TunnelingAgent.addRequest (C:\Users\Friend\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:80:8)
at new ClientRequest (_http_client.js:154:16)
at Object.exports.request (http.js:49:10)
at Object.exports.request (https.js:136:15)
at Request.start (C:\Users\Friend\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:594:30)
at Request.end (C:\Users\Friend\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:1186:28)
I thought it was originating from the proxy, so I set http-proxy and https-proxy like this:
npm config set proxy h t t p://proxydomain:port/
And I set registry like this:
npm config set registry h t t p://registry.npmjs.org/
The error stays the same. I tried to delete the proxy from my network and from npm, but the error is still there.
How can I fix this?
I don't know if you fixed it yet.
But I had the same problem some days ago.
Just uninstall and reinstall node, I actually have with node -v version v0.12.2.
I had upgraded to nodejs 0.12.3 and started having this problem. I then researched and found a fix where I replaced certain files in the tunnel-agent folder. This fix worked but then I started having the same problem again after reinstalling Visual Studio 2013.
I removed node 0.12.3 and then installed 0.10.29 and now it is working again. I got the above error whenever I tried to install a windows platform. So now I am running the latest Cordova version with Node JS 0.10.29. I wonder if I would be able to use a more recent version of node or should I even bother.
From #geisi93 at ionic-cli github
for those who still have problems - propably you have to replace the
contents of
C:\Users{USERNAME}\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\request\node_modules\tunnel-agent
with the contents of with the content of this zip:
https://github.com/mikeal/tunnel-agent
too.
I have installed rhodes and android SDK and NDK
OS: Linux Mint 16 X64, Ruby: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux], SDK: Android.SDK.Release.v23.0.2.Linux, NDK: android-ndk32-r10-linux-x86_64 or android-ndk-r7b
and build.yml content:
#sdk: "/home/abolfazl/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rhodes-3.5.1.12"
sdkversion: 3.5.0
name: testapp
version: 1.0
vendor: rhomobile
build: debug
bbver: 4.6
applog: rholog.txt
iphone:
configuration: Release
sdk: iphonesimulator5.0
provisionprofile:
codesignidentity:
entitlements:
BundleIdentifier: com.rhomobile.testapp
BundleURLScheme: testapp
wp:
productid: '0ed4fa10-0f72-0132-4dc5-3870f4a0dbeb'
symbian:
uid: '0xee1f6bcc'
android:
version: 4.2.2
extensions: ["json", "another-extension"]
sdk manager:
when I run rake run:android:
cd
/home/abolfazl/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rhodes-3.5.1.12
$app_config['extensions'] : ["json", "another-extension"]
$app_config['capabilities'] : [] $vendor = rhomobile $app_package_name
= com.rhomobile.testapp rake aborted! Can't detect NDK toolchain path (corrupted NDK installation?)
Tasks: TOP => run:android => run:android:emulator =>
config:android:emulator => config:android (See full trace by running
task with --trace)
rhodes gem v3.5 was updated on github some times ago to adapt from changes in the newer NDKs (v3.5 was released around release 7 of the NDK).
Newer rhodes (latest is v5) directly supports the new NDKs.
Another thing is that rhodes still needs Ruby v1.9.3, seems that you're using it under Ruby v2.1.
You need to define path to Android NDK at <rhodes>/rhobuild.yml file. Or just run <rhodes>/bin/rhodes-setup
I downloaded the source code of titanium mobile sdk from github. I installed python ,scons ,jdk and android sdk in windows 7. I set path for java,android sdk,etc in environment variable.
but on compiling with scons , following error is rised.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Shihab>cd C:\Project\titanium_mobile
C:\Project\titanium_mobile>scons
scons: Reading SConscript files ...
Building MobileSDK version 3.1.0, githash 2d79a72
KeyError: 14:
File "C:\Project\titanium_mobile\SConstruct", line 115:
sdk = AndroidSDK(ARGUMENTS.get("android_sdk", None), 14)
File "C:\Project\titanium_mobile\support\android\androidsdk.py", line 49:
self.set_api_level(api_level)
File "C:\Project\titanium_mobile\support\android\androidsdk.py", line 53:
self.find_platform_dir()
File "C:\Project\titanium_mobile\support\android\androidsdk.py", line 127:
old_style_dir = os.path.join(self.android_sdk, 'platforms', android_api_leve
ls[api_level])
C:\Project\titanium_mobile>
How to resolve this error?
This forum post says that KeyError: NN means that Android API version NN was not found. Do you have that particular version? (API 14 == Android 4.0)
Why dont you just download Titanium Studio? from the appcelerator page, you can try to create a project there and see if your doing all the configurations correctly