0

I got an android studio project from another person and I am having issues building/debugging due to (I believe) the NDK path.

The error I am getting is "Execution faild for task ':app:externalNativeBuildCleanDebug' due to starting command 'C\Users\OtherUserName\...\ndk-build.cmd'

I have changed the NDK location in File->Project Structure so it is correct but I am not sure what else I need to do. When I do a ctrl-shift-f and find all OtherUserName there is over 1000 occurrences. Any advice on what I need to do?

I am able to Build->Make Project, but when I run->Debug I get a gradle build error described above.

user2840470
  • 919
  • 1
  • 11
  • 23
  • I would suggest your "another person" has hard-coded a path in their code (C\Users\OtherUserName\...\ndk-build.cmd) OUTSIDE of what they have given you (using absolute paths). So you probably don't have ALL the code you need. I would suggest you ask them to fix their code (using relative paths) or share the missing code. ALSO see https://stackoverflow.com/questions/40474050/android-studio-where-to-install-ndk-file-downloaded-it-in-zip/40475804#40475804 for simple environment setup. – Jon Goodwin Oct 24 '17 at 17:01

1 Answers1

1

You probably have no choice but get rid of all occurrences of OtherUserName (but maybe some are pure coincidences).

To begin with, clean up your project: delete the directories build, .externalNativeBuild (recursive for the project). Delete all local.properties and .iml files. I hope that there won't be too many problematic occurrences left. Fix them in your favorite text editor, and import the resulting gradle project into your Android Studio.

NB During all these manipulations, keep a full copy of the original project available as a backup, if some important file gets deleted or screwed up by mistake.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307