Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): build on 64bit Linux fails if no 32bit libs available #442

Merged
merged 2 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/adb.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,6 @@ ADB.prototype.trackDevices = function trackDevices(callback) {
*/
function androidDetect(config, callback) {
(require('./android')).detect(config, null, function (results) {
for (var i = 0, l = results.issues.length; i < l; i++) {
jquick-axway marked this conversation as resolved.
Show resolved Hide resolved
if (results.issues[i].id === 'ANDROID_MISSING_32BIT_LIBS') {
return callback(new Error(results.issues[i].message));
}
}

if (results.sdk && results.sdk.executables.adb) {
callback(null, results);
} else {
Expand Down
45 changes: 0 additions & 45 deletions lib/android.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,51 +374,6 @@ exports.detect = function detect(config, opts, finished) {
+ __('You may be able to fix it by reinstalling your graphics drivers and make sure it installs the 32-bit version.')
});
}

if (results.linux64bit.i386arch === false) {
results.issues.push({
id: 'ANDROID_MISSING_I386_ARCH',
type: 'warning',
message: __('i386 architecture is not configured.') + '\n'
+ __('To ensure you install the required 32-bit libraries, you need to register the i386 architecture with dpkg.') + '\n'
+ __('To add the i386 architecture, run "%s".', '__sudo dpkg --add-architecture i386__')
});
}

var missing32bitLibs = [];
results.linux64bit['libc6:i386'] === false && missing32bitLibs.push('libc6:i386');
results.linux64bit['libncurses5:i386'] === false && missing32bitLibs.push('libncurses5:i386');
results.linux64bit['libstdc++6:i386'] === false && missing32bitLibs.push('libstdc++6:i386');
results.linux64bit['zlib1g:i386'] === false && missing32bitLibs.push('zlib1g:i386');
if (missing32bitLibs.length) {
results.issues.push({
id: 'ANDROID_MISSING_32BIT_LIBS',
type: 'error',
message: __('32-bit libraries is not installed.') + '\n'
+ __('Without the 32-bit libraries, the Android SDK will not work properly.') + '\n'
+ __('To install the required 32-bit libraries, run "%s".', '__sudo apt-get install ' + missing32bitLibs.join(' ') + '__')
});
}

if (results.linux64bit.glibc === false) {
results.issues.push({
id: 'ANDROID_MISSING_32BIT_GLIBC',
type: 'warning',
message: __('32-bit glibc library is not installed.') + '\n'
+ __('Without the 32-bit glibc library, the Android Emulator will not work properly.') + '\n'
+ __('To install the required 32-bit glibc library, run "%s".', '__sudo yum install glibc.i686__')
});
}

if (results.linux64bit.libstdcpp === false) {
results.issues.push({
id: 'ANDROID_MISSING_32BIT_LIBSTDCPP',
type: 'warning',
message: __('32-bit libstdc++ library is not installed.') + '\n'
+ __('Without the 32-bit libstdc++ library, the Android Emulator will not work properly.') + '\n'
+ __('To install the required 32-bit libstdc++ library, run "%s".', '__sudo yum install libstdc++.i686__')
});
}
}

if (!results.ndk) {
Expand Down