flexn-io / renative

🚀🚀🚀 Unified Development Platform for iOS, tvOS, Android, Android TV, Android Wear, Web, Tizen TV, Tizen Watch, Tizen Mobile, LG webOS, macOS/OSX, Windows, KaiOS, FirefoxOS Firefox TV platforms
https://renative.org
MIT License
1.82k stars 180 forks source link

ERRROR! Location of your cli *** does not exist. check your undefined file if your SDK path is correct #528

Closed Ivanov89 closed 4 years ago

Ivanov89 commented 4 years ago

1.Run command rnv start

  1. Run command rnv run -p android
  2. See error

Expected behavior Expected to build the project on android emulator, but crashed with the error:

Screenshot 2020-06-24 at 12 06 23

Desktop (please complete the following information):

Additional context I tried to add my ANDROID_HOME directory to base/renative.json or projectConfig/renative.json

"sdks": { "ANDROID_SDK": "/usr/local/Caskroom/android-sdk/4333796/tools" } - but still with no success..

Where I should change it guys ? Thank you !

pavjacko commented 4 years ago

@Ivanov89 you can manually update your ~/.rnv/renative.json with:

{
     "sdks": {
        "ANDROID_SDK": "/usr/local/Caskroom/android-sdk/4333796"
     }
}

that's the best place to keep your SDK configs

NOTE: you must pass root folder of your SDK (not tools)

typically (on macOS) that's:

For brew installations usually:

Ivanov89 commented 4 years ago

@pavjacko I updated it ,but the problem is that the script still search somewhere the old directory, for example: /Users/Ivanov/Android/platform-tools/adb , how can I delete that old directory from the project or from the script?

Thanks!

pavjacko commented 4 years ago

@Ivanov89 that's strange could you check your project .renative.*.json and appConfigs renative.*.json if you don't override it with ANDROID_SDK

as you're on mac you could also navigate to your project root and try grep -r '"ANDROID_SDK":' ./ see where is it defined (platformBuilds, node_modules can be ignored)

also if you check platformBuilds/<YOUR_APP_ID>_android.json file what do you see there under ANDROID_SDK field?

Ivanov89 commented 4 years ago

Seems, everywhere is the new sdk directory, (in platformBuilds/<myAppID>_android.json too) only in /node_modules/rnv/supportFiles/global-config-template.json is saved the old SDK directory, even I hit rnv clean before every rnv run -p android:

Ivanov@Ivanovs-MacBook-Pro cms-casino % grep -r '"ANDROID_SDK":' ./ .//appConfigs/base/renative.json: "ANDROID_SDK": "/usr/local/Caskroom/android-sdk/4333796" .//node_modules/rnv/supportFiles/global-config-template.json: "ANDROID_SDK": "/Users/<USER>/Library/Android/sdk", .//platformBuilds/cmscasino-stage_android.json: "ANDROID_SDK": "/usr/local/Caskroom/android-sdk/4333796", .//platformBuilds/cmscasino-stage_android.json: "ANDROID_SDK": "/usr/local/Caskroom/android-sdk/4333796" .//platformBuilds/renative.build.json: "ANDROID_SDK": "/usr/local/Caskroom/android-sdk/4333796" .//renative.json: "ANDROID_SDK": "/usr/local/Caskroom/android-sdk/4333796"

pavjacko commented 4 years ago

@Ivanov89 ok let me see.

what do you get if you run cat ~/.rnv/renative.json in teminal ?

BTW you definitely don't need rnv clean before every run. it's an overkill. If you want to cleanup your build just pass -r ie: rnv run -p android -r . that will regenerate the whole android project for you

Ivanov89 commented 4 years ago

after hit cat ~/.rnv/renative.json :

Ivanov@Ivanovs-MacBook-Pro cms-casino % cat ~/.rnv/renative.json { "sdks": { "ANDROID_SDK": "/Users/Ivanov/Android", "ANDROID_NDK": "/Users/<USER>/Library/Android/sdk/ndk-bundle", "IOS_SDK": "No need. Just install Xcode", "TIZEN_SDK": "/Users/<USER>/tizen-studio", "WEBOS_SDK": "/Users/<USER>/Library/webOS_TV_SDK", "KAIOS_SDK": "/Applications/Kaiosrt.app" }, "defaultTargets": { "android": "Nexus_5X_API_26", "androidtv": "Android_TV_720p_API_22", "androidwear": "Android_Wear_Round_API_28", "ios": "iPhone 6", "tvos": "Apple TV 4K", "tizen": "T-samsung-5.0-x86", "tizenwatch": "W-5.0-circle-x86", "webos": "emulator" } }% which is strange because it is not my new sdk directory here, I am expecting to be /usr/local/Caskroom/android-sdk/4333796 ?

pavjacko commented 4 years ago

yup that's it. can you update "ANDROID_SDK" to /usr/local/Caskroom/android-sdk/4333796

Ivanov89 commented 4 years ago

It is updated but I think when I hit cat ~/.rnv/renative.json may be it is overriden, because the below is my code, the above is info from the terminal:

"sdks": { "ANDROID_SDK": "/usr/local/Caskroom/android-sdk/4333796", "ANDROID_NDK": "/Users/<USER>/Library/Android/sdk/ndk-bundle", "IOS_SDK": "No need. Just install Xcode", "TIZEN_SDK": "/Users/<USER>/tizen-studio", "WEBOS_SDK": "/Users/<USER>/Library/webOS_TV_SDK", "KAIOS_SDK": "/Applications/Kaiosrt.app" }, - this is the part from myAppID_android.json file

pavjacko commented 4 years ago

Ok found the culprit. The issue was that RNV checks the existence of your ANDROID_SDK (as folder) and that will return true for /Users/Ivanov/Android however sdk fields are merged (but not used from merge result but workspace original) thus your project specific overrides did not work

I'll make few adjustments to RNV to fix merges and make this issue clearer with correct path pointing to that renative file

for now you have to rely on ~/.rnv/renative.json (workspace location) as only place where you can configure SDKs

Ivanov89 commented 4 years ago

Are you sure I should rely only on ~/.rnv/renative.json (workspace location) , because I configured it only in that place and still don't working ? I updated the RNV to 0.30.1 too right now.

pavjacko commented 4 years ago

@Ivanov89 could you update to rnv@0.30.2-alpha.2 (contains fix I mentioned above) and see if it fixes for you.

if not can you run it with -i parameter (full info log) and check what's printed at CLI Config: and SDK Config: lines

Ivanov89 commented 4 years ago

Hello @pavjacko , thanks for your feedback but unfortunately still doesn't work, so the CLI Config and SDK Config are:

CLI Config: { androidEmulator: '/usr/local/Caskroom/android-sdk/4333796/emulator/emulator', androidAdb: '/usr/local/Caskroom/android-sdk/4333796/platform-tools/adb', androidAvdManager: '/usr/local/Caskroom/android-sdk/4333796/tools/bin/avdmanager', androidSdkManager: '/usr/local/Caskroom/android-sdk/4333796/tools/bin/sdkmanager' } SDK Config: { ANDROID_SDK: '/usr/local/Caskroom/android-sdk/4333796', ANDROID_NDK: '/Users/<USER>/Library/Android/sdk/ndk-bundle', IOS_SDK: 'No need. Just install Xcode', TIZEN_SDK: '/Users/<USER>/tizen-studio', WEBOS_SDK: '/Users/<USER>/Library/webOS_TV_SDK', KAIOS_SDK: '/Applications/Kaiosrt.app' } And when I hit rnv run -p android the following happens: rnv run -p android -i - ERRROR! Location of your cli /usr/local/Caskroom/android-sdk/4333796/platform-tools/adb does not exists. check your /Users/Ivanov/.rnv/renative.json file if your sdks paths are correct I don't have anywhere defined /platform-tools/adb but it is searched it after my correct directory..

pavjacko commented 4 years ago

@Ivanov89 ok I see. Just checked fresh installation of android sdk via homebrew and android-sdk/4333796 only contains tools but no platform-tools where adb typically resides

where is your adb located? just run which adb to get the path

Ivanov89 commented 4 years ago

@pavjacko , thank you for your feedback, it already works after I set again the ANDROID_SDK and after the fix - it accept it correctly ! Thanks again for your support !

Cheers ! :) Todor

pavjacko commented 4 years ago

fix released in 0.30.2