Why is Android Studio trying to concatenate filenames during the build process? - android-studio

I'm trying to build this project: https://github.com/sureshjoshi/android-ndk-swig-example
It's a small example project that uses SWIG to wrap a C++ library for use on Android. I'm getting this error when it builds:
C:\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master\NDKExample\app\src\main\jni\SeePlusPlus_wrap.cxx:802:1: fatal error: opening dependency file C:\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master\NDKExample\app\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/SeePlusPlus/C_\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master\NDKExample\app\src\main\jni\SeePlusPlus_wrap.o.d: No such file or directory
Breaking that up, I see that it's trying to open this file:
C:\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master\NDKExample\app\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/SeePlusPlus/C_\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master\NDKExample\app\src\main\jni\SeePlusPlus_wrap.o.d
Breaking that down further, I see that this filepath contains the absolute path to the project twice, but with the colon replaced with an underscore:
C:\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master\NDKExample\app\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/SeePlusPlus/
C_\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master\NDKExample\app\src\main\jni\SeePlusPlus_wrap.o.d
I'm wondering what might cause this. I have the NDK in a path with no spaces, as that's been known to cause problems. You can see my project has no spaces in its path, either.
The actual line executed during the build that's failing is this, broken up for clarity:
C:\Dev\Android\android-ndk-r10d\ndk-build.cmd
NDK_PROJECT_PATH=null
APP_BUILD_SCRIPT=C:\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master\NDKExample\app\build\intermediates\ndk\debug\Android.mk
APP_PLATFORM=android-21
NDK_OUT=C:\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master\NDKExample\app\build\intermediates\ndk\debug\obj
NDK_LIBS_OUT=C:\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master\NDKExample\app\build\intermediates\ndk\debug\lib
APP_STL=gnustl_shared
APP_ABI=all

This seems to have to do with filepath length. Also had it not work in D:\production\Pong\Devel2010\Src\UnityGames\BhvrDemo\BHVRSWIGTest\
I moved my project folder from
C:\Users\elarson\Desktop\Downloads\android-ndk-swig-example-master
to
D:\Almo\Work\android-ndk-swig-example-master
And now it works, but perhaps only because the filenames are shorter:
D:\Almo\BinkSWIGTest2\NDKExample\app\build\intermediates\ndk\debug\obj\local\arm64-v8a\objs\SeePlusPlus\D_\Almo\BinkSWIGTest2\NDKExample\app\src\main\jni\SeePlusPlus_wrap.o.d
is still created.

Related

class not found error while trying to generate jni headers

why does every time i try to generate jni files, following error pops up?
I have tried specifying class path but it didn't help.
You need to go to classpath and run the command
Follow this guide :
http://www.ntu.edu.sg/home/ehchua/programming/android/android_ndk.html
-classpath: in our case, we need the JNIActivity.class which is kept in "< project-root >\bin\classes"; and its superclass
Android.app.Activity.class which is kept in android.jar under the
Android SDK.
The error is coming because the folder contains *.java files and we are looking for *.class files

Error while adding mp4parser library to a project in android studio

I'm trying to use mp4parser library in my project. My android studio version is 1.0.2. Here's what I've done so far:
I've downloaded mp4parser zipfile from the link: https://github.com/sannies/mp4parser
I've extracted the zip file to MyProjectName/app/libraries
Renamed the folder to mp4parser
Add this line of code to settings.gradle file:
include ':app:libraries:mp4parser'
Add this line of code to build.gradle (in dependencies block):
compile project('libraries:mp4parser')
Now I want to sync the project with gradle files. This error pops up:
Error:Configuration with name 'default' not found.
I don't have this problem with other libraries. Seems that its only mp4parser that I have problem with. How can I fix this?
If you're including the library as source, the best thing to do is to unpack it somewhere and import it as a module.
The error you're getting is cryptic but it means that the build system is looking for a build.gradle file at that location and not finding it (or it doesn't see an apply plugin statement in the file telling it what to do). I'm assuming that the library you're trying to use doesn't have a Gradle build script.
If you import the library using the Android Studio UI, a build script will be generated for the module and you should be good to go.

Gulp Compiling Issues with gulp-ruby-sass

I am having two issues in compiling Sass using Gulp currently. Firstly, I set 777 permissions in my "/Library/Ruby/Gems" directory to free up some permissions errors I was getting. I'm now receiving a warning each time I run Gulp, stating the following:
gulp-ruby-sass: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:213: warning: Insecure world writable dir /Library/Ruby/Gems/2.0.0 in PATH, mode 040777
Second, things seem to halt in terms of Sass compilation when Gulp runs into some of the "#import" declarations in my primary SCSS file. Namely, I get the following errors:
gulp-ruby-sass: error ./screen.scss (Line 4: File to import not found or unreadable: normalize.
Load paths:
/private/var/folders/cq/_pg4s6qn59q1q5fyy5681rd00000gn/T/gulp-ruby-sass/bower_components/compass-breakpoint/stylesheets
/private/var/folders/cq/_pg4s6qn59q1q5fyy5681rd00000gn/T/gulp-ruby-sass/bower_components/susy/sass
/private/var/folders/cq/_pg4s6qn59q1q5fyy5681rd00000gn/T/gulp-ruby-sass/bower_components/normalize-scss
/private/var/folders/cq/_pg4s6qn59q1q5fyy5681rd00000gn/T/gulp-ruby-sass)
These load paths look incorrect...I've installed these components via Bower for this project specifically, so it almost seems like I need to tell Gulp/NPM to look in my project folder instead.
Any help would be greatly appreciated!
Looks like this question was just me doing a whole lot of talking to myself, but I'll share my findings with the world nonetheless.
Turns out, this is a known issue with the gulp-ruby-sass package. See:
https://github.com/sindresorhus/gulp-ruby-sass/pull/80#issuecomment-49531932
Paths specified in the "loadPath" option in my gulpfile were not relative to the gulpfile's location in the project I was working with, so it wound up looking for some Bower components in a folder where it shouldn't have, for example:
/private/var/folders/cq/_pg4s6qn59q1q5fyy5681rd00000gn/T/gulp-ruby-sass/bower_components/compass-breakpoint/stylesheets
I found that, by prepending process.cwd() to each of my file paths, they would become relative.
If you take a look at the GitHub link I added a few lines above, you'll notice this is simply a temporary workaround until this fix is implemented into the master branch of gulp-ruby-sass, so this advice will become irrelevant at some point in the near future.
Hope this helps anybody that was in a similar, puzzled situation.
* EDIT *
As for the permissions warning I was getting for gulp-ruby-sass, it turned out I just needed to run sudo chmod -R 775 /Library/Ruby/Gems/2.0.0 to recursively change the permissions in the Gems directory.

Unable to execute dex: Multiple dex files define Lcom/actionbarsherlock/R$attr;

i use ActionBarLibrary in a library, that I use in a my app
i got this message when i try to compil
[2013-01-28 16:09:46 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/actionbarsherlock/R$attr;
[2013-01-28 16:09:46 - comfree] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/actionbarsherlock/R$attr;
As asked here, I was facing the exact same error yesterday. I pinpointed the cause of the error to /bin/classes. If I deleted the /classes dir before running the app, the app would compile and run. Of course, when I tried to actually export the app, the /classes dir would come back and along with it the error.
The solution to my problem was to install the latest version of Eclipse. You will then need to install the latest version of the ADT but all the Android versions you have downloaded earlier for the other Eclipse installation will be detected and used for this one as well. When I export or run the app through Eclipse, the /classes folder does not appear now.
right click on project to go project property>>java Build path>>choose Order and Export and then Unselect all except android4.0 or what every you have then clean and build your project ,now error not come again..
The solution to my problem was that I deleted the jar files which I copy pasted in project's lib folder. I explicitly imported external jars in build path

Visual C++ - cant see which external missing

I try to build my multiproject application in Visuas C++ 10 in release mode.
I get the next link error:
2> All outputs are up-to-date.
2>PidAppLib.lib(ThreadWin32.obj) : error LNK2011: precompiled object not linked in; image may not run
2>C:\infinite_memories_svn\projects\sw\NewPidTools\PidWriter\Release\PidLabler.exe : fatal error LNK1120: 1 unresolved externals
2>
2>Build FAILED.
How can I know which object unresolved?
ThreadWin32.obj is external lib which was downloaded from internet.
Ok.
I've solved the problem.
I have 2 libraries, let say a.lib and b.lib, and project, c.
a.lib uses b.lib so in librarian dependencies of a.lib I added b.lib, c uses a.lib so I added
it to dependencies.
It works in debug but in release I should also add b.lib to dependencies of c.
Strange but it solved the problem
I had this error in a large project I was refactoring. During the refactoring process I would occasionally compile individual source files to check changes I'd made without having to build the entire project. Depending on your project configuration this can result in .obj files being output in a different directory to where they would normally be output when you build the project. In my case the .obj files for source files compiled manually were output in the source code directory instead of the intermediate build directory.
A side-effect of this appeared to be that when building the whole project, source files that had been manually compiled might not be recompiled even if other changes elsewhere meant they should be (like a change that required recompiling the precompiled header file).
The solution for me was to manually delete all .obj files generated by manually compiling individual source files. Depending on project configuration executing Clean on the project might also work.

Resources