Skip to content
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

Facing build error after manually linking in android #476

Open
SulthanNK opened this issue Jan 30, 2024 · 8 comments
Open

Facing build error after manually linking in android #476

SulthanNK opened this issue Jan 30, 2024 · 8 comments

Comments

@SulthanNK
Copy link

I tried to manually link the package with android base in the readme file documentation and it caused the following build error

Node version: 20.11.0
React native version: both 0.73.3 and 0.72.6
Android version: 11

image.png

@MuhammadAhmed-Developer

implementation project(':@react-native-community_voice')
image
After that also show different error that is below
image
I don't know how to fix this issue If yoou know tell me

@codding123vbf
Copy link

same i was also getting error but this library will without any of the manual steps just install it and use it

@MuhammadAhmed-Developer

same i was also getting error but this library will without any of the manual steps just install it and use it

const SpeechStartHandler =() =>{
    console.log("speech start handler")
}
const SpeechEndHandler =() =>{
    setRecording(false)
    console.log("speech End handler")
}
const SpeechResultsHandler =(e) =>{
    // const recognizedText = e.value[0];
    // console.log("Recognized text:", recognizedText);
    console.log('Resulthandler')
    setResult("How are you?")

}
const SpeechErrorHandler =(e) =>{
    setRecording(false)
    console.log("Error handler:", e)
}

const startRecording = async () =>{
    setRecording(true)
    try{
       await Voice.start("en-US") // en-US
    }catch(err){
        console.log("err", err)
        setRecording(false);
    } 
}

const stopRecording = async () =>{
    try{
        await Voice.stop()
        setRecording(false)
        // fetch responce
    }catch(err){
        console.log("err", err)
    } 
}

useEffect(()=>{
    console.log('use Effect cal')
    Voice.onSpeechStart = SpeechStartHandler;
    Voice.onSpeechEnd = SpeechEndHandler
    Voice.onSpeechResults = SpeechResultsHandler
    Voice.onSpeechError = SpeechErrorHandler

    return () =>{
        // destroy the voice instance
        Voice.destroy().then(Voice.removeAllListeners)
        console.log('Event listeners removed');

    }

},[recording])

I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered

@codding123vbf
Copy link

same i was also getting error but this library will without any of the manual steps just install it and use it

const SpeechStartHandler =() =>{
    console.log("speech start handler")
}
const SpeechEndHandler =() =>{
    setRecording(false)
    console.log("speech End handler")
}
const SpeechResultsHandler =(e) =>{
    // const recognizedText = e.value[0];
    // console.log("Recognized text:", recognizedText);
    console.log('Resulthandler')
    setResult("How are you?")

}
const SpeechErrorHandler =(e) =>{
    setRecording(false)
    console.log("Error handler:", e)
}

const startRecording = async () =>{
    setRecording(true)
    try{
       await Voice.start("en-US") // en-US
    }catch(err){
        console.log("err", err)
        setRecording(false);
    } 
}

const stopRecording = async () =>{
    try{
        await Voice.stop()
        setRecording(false)
        // fetch responce
    }catch(err){
        console.log("err", err)
    } 
}

useEffect(()=>{
    console.log('use Effect cal')
    Voice.onSpeechStart = SpeechStartHandler;
    Voice.onSpeechEnd = SpeechEndHandler
    Voice.onSpeechResults = SpeechResultsHandler
    Voice.onSpeechError = SpeechErrorHandler

    return () =>{
        // destroy the voice instance
        Voice.destroy().then(Voice.removeAllListeners)
        console.log('Event listeners removed');

    }

},[recording])

I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered

on which device you are testing ur code ?

@MuhammadAhmed-Developer

same i was also getting error but this library will without any of the manual steps just install it and use it

const SpeechStartHandler =() =>{
    console.log("speech start handler")
}
const SpeechEndHandler =() =>{
    setRecording(false)
    console.log("speech End handler")
}
const SpeechResultsHandler =(e) =>{
    // const recognizedText = e.value[0];
    // console.log("Recognized text:", recognizedText);
    console.log('Resulthandler')
    setResult("How are you?")

}
const SpeechErrorHandler =(e) =>{
    setRecording(false)
    console.log("Error handler:", e)
}

const startRecording = async () =>{
    setRecording(true)
    try{
       await Voice.start("en-US") // en-US
    }catch(err){
        console.log("err", err)
        setRecording(false);
    } 
}

const stopRecording = async () =>{
    try{
        await Voice.stop()
        setRecording(false)
        // fetch responce
    }catch(err){
        console.log("err", err)
    } 
}

useEffect(()=>{
    console.log('use Effect cal')
    Voice.onSpeechStart = SpeechStartHandler;
    Voice.onSpeechEnd = SpeechEndHandler
    Voice.onSpeechResults = SpeechResultsHandler
    Voice.onSpeechError = SpeechErrorHandler

    return () =>{
        // destroy the voice instance
        Voice.destroy().then(Voice.removeAllListeners)
        console.log('Event listeners removed');

    }

},[recording])

I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered

on which device you are testing ur code ?

Android
oppo a54

@codding123vbf
Copy link

same i was also getting error but this library will without any of the manual steps just install it and use it

const SpeechStartHandler =() =>{
    console.log("speech start handler")
}
const SpeechEndHandler =() =>{
    setRecording(false)
    console.log("speech End handler")
}
const SpeechResultsHandler =(e) =>{
    // const recognizedText = e.value[0];
    // console.log("Recognized text:", recognizedText);
    console.log('Resulthandler')
    setResult("How are you?")

}
const SpeechErrorHandler =(e) =>{
    setRecording(false)
    console.log("Error handler:", e)
}

const startRecording = async () =>{
    setRecording(true)
    try{
       await Voice.start("en-US") // en-US
    }catch(err){
        console.log("err", err)
        setRecording(false);
    } 
}

const stopRecording = async () =>{
    try{
        await Voice.stop()
        setRecording(false)
        // fetch responce
    }catch(err){
        console.log("err", err)
    } 
}

useEffect(()=>{
    console.log('use Effect cal')
    Voice.onSpeechStart = SpeechStartHandler;
    Voice.onSpeechEnd = SpeechEndHandler
    Voice.onSpeechResults = SpeechResultsHandler
    Voice.onSpeechError = SpeechErrorHandler

    return () =>{
        // destroy the voice instance
        Voice.destroy().then(Voice.removeAllListeners)
        console.log('Event listeners removed');

    }

},[recording])

I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered

on which device you are testing ur code ?

Android oppo a54

what android version ?

@MuhammadAhmed-Developer

same i was also getting error but this library will without any of the manual steps just install it and use it

const SpeechStartHandler =() =>{
    console.log("speech start handler")
}
const SpeechEndHandler =() =>{
    setRecording(false)
    console.log("speech End handler")
}
const SpeechResultsHandler =(e) =>{
    // const recognizedText = e.value[0];
    // console.log("Recognized text:", recognizedText);
    console.log('Resulthandler')
    setResult("How are you?")

}
const SpeechErrorHandler =(e) =>{
    setRecording(false)
    console.log("Error handler:", e)
}

const startRecording = async () =>{
    setRecording(true)
    try{
       await Voice.start("en-US") // en-US
    }catch(err){
        console.log("err", err)
        setRecording(false);
    } 
}

const stopRecording = async () =>{
    try{
        await Voice.stop()
        setRecording(false)
        // fetch responce
    }catch(err){
        console.log("err", err)
    } 
}

useEffect(()=>{
    console.log('use Effect cal')
    Voice.onSpeechStart = SpeechStartHandler;
    Voice.onSpeechEnd = SpeechEndHandler
    Voice.onSpeechResults = SpeechResultsHandler
    Voice.onSpeechError = SpeechErrorHandler

    return () =>{
        // destroy the voice instance
        Voice.destroy().then(Voice.removeAllListeners)
        console.log('Event listeners removed');

    }

},[recording])

I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered

on which device you are testing ur code ?

Android oppo a54

what android version ?

Android version 11

@codding123vbf
Copy link

same i was also getting error but this library will without any of the manual steps just install it and use it

const SpeechStartHandler =() =>{
    console.log("speech start handler")
}
const SpeechEndHandler =() =>{
    setRecording(false)
    console.log("speech End handler")
}
const SpeechResultsHandler =(e) =>{
    // const recognizedText = e.value[0];
    // console.log("Recognized text:", recognizedText);
    console.log('Resulthandler')
    setResult("How are you?")

}
const SpeechErrorHandler =(e) =>{
    setRecording(false)
    console.log("Error handler:", e)
}

const startRecording = async () =>{
    setRecording(true)
    try{
       await Voice.start("en-US") // en-US
    }catch(err){
        console.log("err", err)
        setRecording(false);
    } 
}

const stopRecording = async () =>{
    try{
        await Voice.stop()
        setRecording(false)
        // fetch responce
    }catch(err){
        console.log("err", err)
    } 
}

useEffect(()=>{
    console.log('use Effect cal')
    Voice.onSpeechStart = SpeechStartHandler;
    Voice.onSpeechEnd = SpeechEndHandler
    Voice.onSpeechResults = SpeechResultsHandler
    Voice.onSpeechError = SpeechErrorHandler

    return () =>{
        // destroy the voice instance
        Voice.destroy().then(Voice.removeAllListeners)
        console.log('Event listeners removed');

    }

},[recording])

I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered

on which device you are testing ur code ?

Android oppo a54

what android version ?

Android version 11

add this in ur manifest file to make it work on android 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants