lukeweber / webrtc-jingle-client

Webrtc audio + jingle protocol brought to IOS and Android.
https://groups.google.com/forum/?fromgroups#!forum/webrtc-jingle
BSD 3-Clause "New" or "Revised" License
336 stars 136 forks source link

Maven install failure #80

Closed Boudewijn26 closed 11 years ago

Boudewijn26 commented 11 years ago

When I try the mvn install command, I get the following failure:

Failed to execute goal org.codehaus.mojo:native-maven-plugin:1.0-alpha-7:javah (generateNative) on project voice-core:
Error running javah command: Error executing command line. Exit code:1 -> [Help 1].

I managed to trace this to the javah command and after some research I suspect the android.jar of the platform isn't in the class path. This is based mostly on the following output:

cmd.exe /X /C "javah -d C:\Users\***\workspace\libjingle-project\trunk\android\voice-client-core\jni
-classpath C:\Users\***\workspace\libjingle-project\trunk\android\voice-client-core\target\classes -verbose 
com.tuenti.voice.core.VoiceClient"
Error: Class android.content.Context could not be found.

Note: this is done in cygwin, although someone might expect maven to be at least somewhat platform independent. Also I'm absolutely sure my paths are correct.

I've spent the better part of this Sunday trying to get WebRTC to work on Android in any form and this is the farthest I've managed to come, so I'd really appreciate any help getting me further.

lukeweber commented 11 years ago

First, complete build still will require mac of linux to build the core, as that part won't build on windows.

In terms of this particular bug, basically android-14/android.jar isn't in the classpath for this command.

A bit more discussion here: https://groups.google.com/forum/?fromgroups=#!topic/webrtc-jingle/Bm4E5oefjeE

I'll try to follow up on this, but if anyone wants to post back what works for them, and is the best fix for linux, would be appreciated.

Thee options that I can think of: 1) Fix native android plugin, javah part to include android sdk to the path. Don't know why this works on mac just fine. 2) Test whether changing private native void nativeInit( Context context ); to private native void nativeInit( Object context ) would also solve the issue. In the jni it's just converted to jobject anyhow, so should be fine. 3) Temporarily remove javah jni generation from pom.xml, and ignore for now that it doesn't work as we already have the file under version control.

Boudewijn26 commented 11 years ago

I tried both option 2 and 3. Options 2 resulted in the same failure.

Options 3 resulted in the following failure:

Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.1:ndk-build (executeNdk) 
on project voice-core: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C "C:\Users\***\AppData\Local\Android\android-ndk-r8e\ndk-build.cmd -C 
C:\Users\***\workspace\libjingle-project\trunk\android\voice-client-core NDK_APPLICATION_MK=jni/default_debug.mk -j 8 
NDK_APP_OUT=C:\Users\***\workspace\libjingle-project\trunk\android\voice-client-core/obj/default_debug all", Result = 2 -> [Help 1]

By now I've decided I hate Windows and should never try to program native on a Windows computer again.

I'll wait until someone posts a full step by step tutorial for building WebRTC on a Windows computer, until then I wish you the best of luck taking this project further.

jreyes commented 11 years ago

I do this to work on a windows machine. https://www.youtube.com/watch?v=f0NU-E8l_qQ