-
- Notifications
You must be signed in to change notification settings - Fork 447
add steps on how to debug the android runtime in Android Studio #982
Conversation
9f9cd07
to 52795f3
Compare 52795f3
to 6632d9f
Compare 06d052a
to 716f249
Compare There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on the article. I left a couple of comments on grammar and wording.
| ||
# Debugging the Android Runtime within your app's Android Studio project | ||
| ||
## What is this document about? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename the header to a more generic one like 'Overview', or maybe even Debugging the Runtime
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the name from the iOS article, and tried and keep it as close to it as possible, hence the name
| ||
## What is this document about? | ||
| ||
In certain scenarios where runtime errors occur, the debug info provided by the NativeScript CLI are not sufficient. This article will guide you through the steps needed to debug the Android Runtime library module as a part of your NativeScript application. It implies you have the [android-runtime repository](https://github.com/NativeScript/android-runtime) already cloned and set up. For more info on how to setup the android-runtime project on your machine refer to its [README](https://github.com/NativeScript/android-runtime/blob/master/README.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'the debug info is not sufficient.'
'It implies you have already cloned and setup the ...'
...on how to setup the android-runtime project on your workstation, refer to the repository README ...
| ||
## Creating the sample application | ||
| ||
### 1. Create a new NativeScript application using one of the following commands depending on your platform preference: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... commands depending on your language/technology preference:
| ||
`tns prepare android` | ||
| ||
> After you have prepared the project, make sure the `tns-android` version is at least 3.4.0, because that's the version the Android Studio support is introduced. You can check the version by running `tns info` inside the project folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to the beginning of the subsection and maybe start with 'Before preparing the project, make sure...'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The users can't make sure the installed tns-android
version, before actually adding it, by running prepare
or platform add
. That's why I've put the note after the commands.
### 3. Open the Android Studio project: | ||
| ||
* Open Android Studio | ||
* `File/Open` or `Open an existing Android Studio project` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click File -> Open
or Open an existing Android Studio project
| ||
### 1. Make sure you have NDK and SDK directories set, because it's needed to build the Android runtime. | ||
| ||
* `File/Project Structure` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click File -> Project Structure
### 1. Make sure you have NDK and SDK directories set, because it's needed to build the Android runtime. | ||
| ||
* `File/Project Structure` | ||
* SDK Location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Navigate to/Select the SDK Location
section
* SDK Location | ||
* Check if Android NDK and SDK Location is set | ||
| ||
After set up the Project Structure should look like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the setup, the Project Structure
dialog/window should look like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a couple more suggestions how the article can be improved.
I also think you could include references to this article in https://docs.nativescript.org/tooling/debugging's See also
section
 | ||
| ||
* Uncomment the included projects: `:runtime` and `:runtime-binding-generator` | ||
* Uncomment and set the `:runtime` and `:runtime-binding-generator` project dirs. These project dirs, can be found in the already cloned [android-runtime repository](https://github.com/NativeScript/android-runtime). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the already cloned
remark sounds like an unnecessary addition, considering the user is that deep into setting up their project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer being specific rather than misunderstood.
| ||
 | ||
| ||
After the files are synced you should see the `:runtime` and `:runtime-binding-generator` modules in Android Studio and should look like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the sync has completed, the ...
and ...
modules should appear in the Project view in Android Studio:
| ||
## Debug the Android Runtime | ||
| ||
### 1. How to debug the Java part of the runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Debugging the runtime Java code'
| ||
 | ||
| ||
> When you run the project in debug, you should see in the `Gradle Console`(bottom right) the Android Runtime being built. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you run the project in debug, you should see the Android Runtime build log in the Gradle Console
(bottom right).
| ||
## Known Issues | ||
| ||
If you have native plugins in your application, you will still be able to build it with Android Studio, but you won't be able to debug it with the Android runtime. We will fix that issue in the upcoming releases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
native plugins in the sense of c++ or Android Libraries? Since we are introducing the subject of debugging c++ code, we don't want to confuse the enthusiastic developers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true that, will rephrase
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
After 3.4.0 release, we have Integration with Android Studio.
That means users will be able to debug their application with any nativescript android runtime
^3.4.0
.This is the documentation explaining how can an application be debugged with the runtime.
Kept the structure close to the iOS docs.