triniwiz / nativescript-webrtc

Apache License 2.0
42 stars 25 forks source link

Attempt to invoke virtual method 'java.lang.String org.webrtc.MediaStream.getId()' on a null object reference #32

Closed hrueger closed 4 years ago

hrueger commented 4 years ago

Make sure to check the demo app(s) for sample usage

I did.

Make sure to check the existing issues in this repository

I did.

If the demo apps cannot help and there is no issue for your problem, tell us about it

I ran into the same issue as #31 . So I searched on the internet and found out that it could be a problem with the multi dex config. My app.gradle looks like this:

dependencies {
  compile 'com.android.support:multidex:1.0.0'
}

android {  
  defaultConfig {  
    generatedDensities = []
    applicationId = "tld.domain.subdomain" 
    multiDexEnabled true  
  }  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }
  compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
  }
} 
def settingsGradlePath
if(project.hasProperty("appResourcesPath")){
    settingsGradlePath = "$project.appResourcesPath/Android/settings.gradle";
} else {
    settingsGradlePath = "$rootDir/../../app/App_Resources/Android/settings.gradle";
}
def settingsGradleFile = new File(settingsGradlePath);
if(settingsGradleFile.exists())
{
    apply from: settingsGradleFile;
}

I added android.enableDexingArtifactTransform.desugaring=false to the App_Ressources/Android/gradle.properties which solved #31 . But now, once I open the call component which includes the readme's sample code, I get this error message after I got asked for the camera and microphone permissions: error

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Create a nativescript (angular) project, change app.gradle to the provided one and add android.enableDexingArtifactTransform.desugaring=false to the App_Ressources/Android/gradle.properties.

Is there any code involved?

See above