Skip to content

Commit

Permalink
Fix android not rendering in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
DCrow committed Apr 3, 2024
1 parent a8c2cc2 commit 8d34a42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
def variant = project.hasProperty("yandexMapkit.variant") ? project.property("yandexMapkit.variant") : "lite"
def initClass = "com.unact.yandexmapkit." + variant + ".Init" + variant.capitalize() + ".class"

group 'com.unact.yandexmapkit'
version '1.0-SNAPSHOT'
Expand Down Expand Up @@ -45,7 +46,7 @@ android {
defaultConfig {
minSdkVersion 21

buildConfigField "String", "YANDEX_MAPKIT", "\"${variant}\""
buildConfigField "Class", "YANDEX_MAPKIT_INIT_CLASS", initClass
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
public class YandexMapkitPlugin implements FlutterPlugin, ActivityAware {
private final Init variantInit;

public YandexMapkitPlugin() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
String name = "com.unact.yandexmapkit." + BuildConfig.YANDEX_MAPKIT + ".Init" +
BuildConfig.YANDEX_MAPKIT.substring(0, 1).toUpperCase() + BuildConfig.YANDEX_MAPKIT.substring(1);

this.variantInit = (Init) Class.forName(name).newInstance();
public YandexMapkitPlugin() throws IllegalAccessException, InstantiationException {
this.variantInit = (Init) BuildConfig.YANDEX_MAPKIT_INIT_CLASS.newInstance();
}

@Override
Expand Down

0 comments on commit 8d34a42

Please sign in to comment.