-
-
Notifications
You must be signed in to change notification settings - Fork 197
-sdk option does not set android:targetSdkVersion="XX" in AndroidManifest.xml #840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
teobugslayer
added a commit
that referenced
this issue
Sep 1, 2015
rosen-vladimirov
added a commit
that referenced
this issue
Sep 2, 2015
When android platform is added, we should add information about the targetSdk in the created `AndroidManifest.xml`. This way the platform add command will work in the following way: * `tns platform add android` - adds the android platform and inside `<projectDir>/platforms/android/src/main/AndroidManifest.xml` will add the value of the androidSDK that the CLI had calculated. CLI uses latest supported and installed version of the android SDK, for example if CLI supports versions 21, 22 and 23 and the user had installed 19, 21 and 22, 22 will be used. * `tns platform add android --sdk <value>` - adds the android platform and inside `<projectDir>/platforms/android/src/main/AndroidManifest.xml` will add the value of the androidSDK that the user had specified (if it is valid one). The above behavior will fix [this issue](#840) Every build/run, etc. will use the value specified in the `AndroidManifest.xml`. In case you want to test with another sdk, there's no need to remove the platform and add the platform again. You can use `--sdk` option to all build related commands and this will build the project with the specified SDK version, but will **NOT** update `AndroidManifest.xml`. This way `--sdk` can be used for testing other SDK versions, without breaking the current project. > NOTE: In case you have not added platform and you run `tns <run/build/deploy/prepare/update> android --sdk 19`, this will add the android platform and specify android:targetSdkVersion="19" in the `AndroidManifest.xml` file. All other calls will not update the AndroidManifest.xml file.
rosen-vladimirov
added a commit
that referenced
this issue
Sep 5, 2015
We should pass correct parameters to android build. We need: * Compile SDK - at least 21 * BuildTools version - at least 22 * AppCompat lib (Android Support) version - same as compile SDK * Target SDK - the selected target by user - there's no need to have it Add AndroidToolsInfo class that calculates all required and installed versions of required Android tools. This class prints warnings when the public method getToolsInfo is called without parameters and prints errors when the showWarningsAsErrors parameter is set to true. When `tns doctor` command is called, the checks will print warnings and when `tns platform add android` or `tns build/prepare... android` commands are used, the AndroidToolsInfo will break the execution when incorrect Android setup is detected. Fixes #840
rosen-vladimirov
added a commit
that referenced
this issue
Sep 5, 2015
We should pass correct parameters to android build. We need: * Compile SDK - at least 21 * BuildTools version - at least 22 * AppCompat lib (Android Support) version - same as compile SDK * Target SDK - the selected target by user - there's no need to have it Add AndroidToolsInfo class that calculates all required and installed versions of required Android tools. This class prints warnings when the public method getToolsInfo is called without parameters and prints errors when the showWarningsAsErrors parameter is set to true. When `tns doctor` command is called, the checks will print warnings and when `tns platform add android` or `tns build/prepare... android` commands are used, the AndroidToolsInfo will break the execution when incorrect Android setup is detected. Fixes #840
rosen-vladimirov
added a commit
that referenced
this issue
Sep 7, 2015
We should pass correct parameters to android build. We need: * Compile SDK - at least 21 * BuildTools version - at least 22 * AppCompat lib (Android Support) version - same as compile SDK * Target SDK - the selected target by user - there's no need to have it Add AndroidToolsInfo class that calculates all required and installed versions of required Android tools. This class prints warnings when the public method getToolsInfo is called without parameters and prints errors when the showWarningsAsErrors parameter is set to true. When `tns doctor` command is called, the checks will print warnings and when `tns platform add android` or `tns build/prepare... android` commands are used, the AndroidToolsInfo will break the execution when incorrect Android setup is detected. Fixes #840
rosen-vladimirov
added a commit
that referenced
this issue
Sep 7, 2015
We should pass correct parameters to android build. We need: * Compile SDK - at least 21 * BuildTools version - at least 22 * AppCompat lib (Android Support) version - same as compile SDK * Target SDK - the selected target by user - there's no need to have it Add AndroidToolsInfo class that calculates all required and installed versions of required Android tools. This class prints warnings when the public method getToolsInfo is called without parameters and prints errors when the showWarningsAsErrors parameter is set to true. When `tns doctor` command is called, the checks will print warnings and when `tns platform add android` or `tns build/prepare... android` commands are used, the AndroidToolsInfo will break the execution when incorrect Android setup is detected. Fixes #840
rosen-vladimirov
added a commit
that referenced
this issue
Sep 7, 2015
We should pass correct parameters to android build. We need: * Compile SDK - at least 21 * BuildTools version - at least 22 * AppCompat lib (Android Support) version - same as compile SDK * Target SDK - the selected target by user - there's no need to have it Add AndroidToolsInfo class that calculates all required and installed versions of required Android tools. This class prints warnings when the public method getToolsInfo is called without parameters and prints errors when the showWarningsAsErrors parameter is set to true. When `tns doctor` command is called, the checks will print warnings and when `tns platform add android` or `tns build/prepare... android` commands are used, the AndroidToolsInfo will break the execution when incorrect Android setup is detected. Fixes #840
rosen-vladimirov
added a commit
that referenced
this issue
Sep 7, 2015
We should pass correct parameters to android build. We need: * Compile SDK - at least 21 * BuildTools version - at least 22 * AppCompat lib (Android Support) version - same as compile SDK * Target SDK - the selected target by user - there's no need to have it Add AndroidToolsInfo class that calculates all required and installed versions of required Android tools. This class prints warnings when the public method getToolsInfo is called without parameters and prints errors when the showWarningsAsErrors parameter is set to true. When `tns doctor` command is called, the checks will print warnings and when `tns platform add android` or `tns build/prepare... android` commands are used, the AndroidToolsInfo will break the execution when incorrect Android setup is detected. Fixes #840
rosen-vladimirov
added a commit
that referenced
this issue
Sep 7, 2015
We should pass correct parameters to android build. We need: * Compile SDK - at least 21 * BuildTools version - at least 22 * AppCompat lib (Android Support) version - same as compile SDK * Target SDK - the selected target by user - there's no need to have it Add AndroidToolsInfo class that calculates all required and installed versions of required Android tools. This class prints warnings when the public method getToolsInfo is called without parameters and prints errors when the showWarningsAsErrors parameter is set to true. When `tns doctor` command is called, the checks will print warnings and when `tns platform add android` or `tns build/prepare... android` commands are used, the AndroidToolsInfo will break the execution when incorrect Android setup is detected. Fixes #840
vchimev
pushed a commit
to NativeScript/nativescript-cli-tests
that referenced
this issue
Sep 8, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After we migrated to gradle --sdk option does not set android:targetSdkVersion="XX" in AndroidManifest.xml
Steps to reproduce:
tns create TNS_App
tns platform add android --sdk 19 --frameworkPath tns-android.tgz --path TNS_App
Can't find this in AndroidManifest:
android:targetSdkVersion="19"
It was set correctly before.
The text was updated successfully, but these errors were encountered: