解决项目打包的 apk 安装后无法运行的问题。
This commit is contained in:
@@ -423,7 +423,9 @@ public class BuildActivity extends BaseActivity implements ApkBuilder.ProgressCa
|
|||||||
|
|
||||||
private ApkBuilder.AppConfig createAppConfig() {
|
private ApkBuilder.AppConfig createAppConfig() {
|
||||||
if (mProjectConfig != null) {
|
if (mProjectConfig != null) {
|
||||||
return ApkBuilder.AppConfig.fromProjectConfig(mSource, mProjectConfig);
|
return ApkBuilder.AppConfig.fromProjectConfig(mSource, mProjectConfig)
|
||||||
|
.setAbis(getSelectedAbis())
|
||||||
|
.setLibs(getSelectedLibs());
|
||||||
}
|
}
|
||||||
String jsPath = mSourcePath.getText().toString();
|
String jsPath = mSourcePath.getText().toString();
|
||||||
String versionName = mVersionName.getText().toString();
|
String versionName = mVersionName.getText().toString();
|
||||||
@@ -431,6 +433,18 @@ public class BuildActivity extends BaseActivity implements ApkBuilder.ProgressCa
|
|||||||
String appName = mAppName.getText().toString();
|
String appName = mAppName.getText().toString();
|
||||||
String packageName = mPackageName.getText().toString();
|
String packageName = mPackageName.getText().toString();
|
||||||
|
|
||||||
|
return new ApkBuilder.AppConfig()
|
||||||
|
.setAppName(appName)
|
||||||
|
.setSourcePath(jsPath)
|
||||||
|
.setPackageName(packageName)
|
||||||
|
.setVersionName(versionName)
|
||||||
|
.setVersionCode(versionCode)
|
||||||
|
.setAbis(getSelectedAbis())
|
||||||
|
.setLibs(getSelectedLibs())
|
||||||
|
.setIcon(mIsDefaultIcon ? null : () -> BitmapUtils.drawableToBitmap(mIcon.getDrawable()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArrayList<String> getSelectedAbis() {
|
||||||
ArrayList<String> abis = new ArrayList<>();
|
ArrayList<String> abis = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < mFlexboxAbis.getChildCount(); i += 1) {
|
for (int i = 0; i < mFlexboxAbis.getChildCount(); i += 1) {
|
||||||
@@ -445,6 +459,10 @@ public class BuildActivity extends BaseActivity implements ApkBuilder.ProgressCa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return abis;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArrayList<String> getSelectedLibs() {
|
||||||
ArrayList<String> libs = new ArrayList<>();
|
ArrayList<String> libs = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < mFlexboxLibs.getChildCount(); i += 1) {
|
for (int i = 0; i < mFlexboxLibs.getChildCount(); i += 1) {
|
||||||
@@ -459,15 +477,7 @@ public class BuildActivity extends BaseActivity implements ApkBuilder.ProgressCa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ApkBuilder.AppConfig()
|
return libs;
|
||||||
.setAppName(appName)
|
|
||||||
.setSourcePath(jsPath)
|
|
||||||
.setPackageName(packageName)
|
|
||||||
.setVersionName(versionName)
|
|
||||||
.setVersionCode(versionCode)
|
|
||||||
.setAbis(abis)
|
|
||||||
.setLibs(libs)
|
|
||||||
.setIcon(mIsDefaultIcon ? null : () -> BitmapUtils.drawableToBitmap(mIcon.getDrawable()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ApkBuilder callApkBuilder(File tmpDir, File outApk, ApkBuilder.AppConfig appConfig) throws Exception {
|
private ApkBuilder callApkBuilder(File tmpDir, File outApk, ApkBuilder.AppConfig appConfig) throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user