dart-lang / dart-lang/native

Improve detection of Android SDK and Dependencies.

Open
#793 8 comments 0 reactions 0 assignees View on GitHub
package:jni package:jnigen
Dominant language
Dart
Stars
275
Forks
144
Avg merge
2d 10h
Merged PRs (30d)
47

Description

1. Finding Android SDK is done through ANDROID_SDK_ROOT environment variable but there's no guarantee it's set on all systems. Best method will be somehow obtain the config of Flutter SDK, but not sure it can be programmatically obtained, other than grepping the output of `flutter doctor`.

2. Android's core library stubs are in android.jar and easy to find once we have SDK root. But other libraries including `androidx` are fetched by gradle and included in compile classpath. It would be nice to have a way to obtain compile classpath for android part of the flutter project. (The use case is writing some platform specific java code in `android/` part of the flutter project and integrating it via `jnigen`.).

Alternatively it might be possible to copy dependency jars into temporary folder like we are doing with maven. I am still investigating it. It's important to not to tamper with any existing gradle config or leave trace of stub files created..

A point of friction is that Android gradle plugin does so many things differently and answers / guides related to standard java - gradle combination don't work anymore. :(

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.