Skip to content

Commit

Permalink
fixed Get the BuildConfig exception if the Activity is not at the top…
Browse files Browse the repository at this point in the history
… level of the package
  • Loading branch information
yuzhiqiang1993 committed Mar 26, 2023
1 parent d4bfd50 commit c0da2f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/src/org/apache/cordova/BuildHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public static Object getBuildConfigValue(Context ctx, String key)
{
try
{
Class<?> clazz = Class.forName(ctx.getClass().getPackage().getName() + ".BuildConfig");
String packageName = ctx.getApplicationInfo().packageName;
Class<?> clazz = Class.forName(packageName + ".BuildConfig");
Field field = clazz.getField(key);
return field.get(null);
} catch (ClassNotFoundException e) {
Expand Down

0 comments on commit c0da2f6

Please sign in to comment.