-
Notifications
You must be signed in to change notification settings - Fork 258
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
React Native apps fail to build since NDK update to r17 (due to missing mipsel-linux-android-4.9 toolchain files) #700
Comments
Mips is no longer officially supported by the NDK, so you can get past this by removing those configurations from your default build. See the announcements for r17 on https://developer.android.com/ndk/downloads/revision_history. |
@sunweiyang Does React Native support MIPS in the first place: https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/jni/Application.mk#L3 |
@kneth The RN codebase includes support for armeabi-v7a, which uses the mipsel-linux-android-4.9 toolchain. |
@sunweiyang I'm confused. armeabi-v7a is the ABI for 32-bit ARM and mipsel* is for 32-bit MIPS targets. There are no mipsel* tools that should be used for any part of an ARM build. |
Any updates @sunweiyang? |
@sunweiyang I tried to use your workaround on AppCenter but it doesn't work |
@kneth @stephenhines @steverob Apologies for the confusion -- the issue seems to center around the use of AppCenter (as described in microsoft/appcenter-sdk-react-native#317). @krystiansliwa, it looks like you were able to get the clarification you needed in microsoft/appcenter-sdk-react-native#317 as well -- glad to see it. |
This problem haunts not only React Native, but many other users who download the latest NDK and don't update their Gradle plugin. This happens regardless of abiFIlters, and even for people who only have 3ʳᵈ party prebuilt native libraries. The workaround is actually trivial, it's a pity it was not included in r17: Add two dummy executable files |
i'm a bit confused because i thought this was the issue @rprichard found in the betas, and that that was the workaround that's in r17? |
r17 has various mostly-empty directories, but no fake strip binaries:
I'm wondering what version of the Gradle plugin is having issues here. |
yeah, microsoft/appcenter-sdk-react-native#317 just says "3.1.2 doesn't have this problem". hopefully @alexcohn's comment means he's seen this himself and can tell us what gradle version it was with? |
For me, 3.0.1 failed on this. I see many complaints on SO, and not everybody takes easily the advice "just upgrade your gradle plugin to 3.1.2" because this also means that they need to upgrade gradle to at least gradle-4.4 and then fix something else… The difference is that the files build.gradle and gradle/wrapper/gradle-wrapper.properties are under source control, and people often pull them from outdated repositories. At the same time, their Android Studio automatically installs NDK r.17 without warning them that they need now to upgrade all their modules to latest gradle plugin. And it does work sometimes. Only the unhappy circumstance that one of their dependencies has some mips native library packaged breaks the build. |
@rprichard --- is that the difference between the bug(s) we found and this one that we didn't? we didn't test a project that didn't have mips configured but did have a mips prebuilt? (if i understand correctly what alexcohn is saying.) |
That sounds plausible. I'll do some testing. I created a new React Native project today using instructions at https://facebook.github.io/react-native/docs/getting-started.html. Here's what I've noticed so far:
|
I can reproduce a problem with Studio 3.0.1 and NDK r17:
Notes:
|
quite predictably, the complaints and weird workarounds for the missing …-strip executables are spreading like bushfire |
The problem is that a given gradle plugin does not support every version of the NDK and the NDK is being updated without the gradle plugin. Studio absolutely needs to do a better job of helping users not point the gun at their foot, but fundamentally the configuration causing this bug needs to be avoided. I've summarized @alexcohn's comments above into a couple of bugs for Studio: http://b/80431718 Studio pins gradle plugin revisions but not NDK revisions, even though they are related It sounds like these two issues are at the crux of the problem. Migrating to newer build tools during a project's development is hard, and Studio/gradle are making it hard to avoid that process. All that said, the 3.1 build tools are now in the stable channel and do not have this problem, so the fix for this is to update to the latest version of the build tools. If it's not a good time to do that for your project, you have two options: The first option is to apply this workaround from Stack Overflow: // In build.gradle
packagingOptions{
doNotStrip '*/mips/*.so'
doNotStrip '*/mips64/*.so'
} The second is to continue using NDK r16b with the 3.0 build tools. Download the previous version of the NDK from https://developer.android.com/ndk/downloads/, extract it somewhere, and change the |
@DanAlbert 's work around doesn't work for me. Either I put it inside a subproject{} and get Or in base build.gradle: |
Very crude quick-fix
|
- classpath 'com.android.tools.build:gradle:2.2.3'
+ classpath 'com.android.tools.build:gradle:2.3.3'
- distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
+ distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip |
I had a similar issue but with I followed #700 (comment) but still got a build error I also had to do |
Description
Android React Native apps have not been able to successfully build since we updated NDK to r17. The build error shows this:
To work around this, our team had to manually replace the bare NDK r17
~/Library/Android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/
and~/Library/Android/sdk/ndk-bundle/toolchains/mipsel-linux-android-4.9/
directories with those of the old NDK r16. Almost all files that were once in these 2 directories bacvk in NDK r16 are completely gone in the new NDK r17.Steps to reproduce:
(Use this link if issues arise with Android dev environment: https://facebook.github.io/react-native/docs/getting-started.html)
2. Open an Android emulator and build the Android app using
react-native run-android
3. Observe the following build error:
The text was updated successfully, but these errors were encountered: