newventuresoftware / WaveformControl

Android Waveform control
236 stars 67 forks source link

Error: unable to build the project #10

Open pcdus opened 6 years ago

pcdus commented 6 years ago

Hello, I open the solution through Android Studio, and I try to build it, but I get the following error message:

error: unknown element found. Message{kind=ERROR, text=error: unknown element found., sources=[C:\Projets\WaveformControl-master\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:13], original message=, tool name=Optional.of(AAPT)}

AndroidDeveloperLB commented 6 years ago

@Goldstrike They haven't updated it for a long time. Attached here the project after updating it. WaveformControl.zip

AndroidDeveloperLB commented 6 years ago

But I don't get where in the code (if it even exists) it records the audio into file and where I can stop it. So I asked about it here: https://github.com/newventuresoftware/WaveformControl/issues/11

yavor87 commented 6 years ago

It's true I haven't updated the project for a while and some things changed. I have an update commit ready, but there seems to be some permission problem that I need to sort out. Thank you @AndroidDeveloperLB for the updated project!

AndroidDeveloperLB commented 6 years ago

Oh, I forgot about the permission part. It's not hard though. Just make it request the permissions, as such (copied from some code I wrote in Kotlin) :

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        val permissionsToRequest = getAppDeclaredPermissions(this)
        requestPermissions(permissionsToRequest, 0)
    }

    @JvmStatic
    fun getAppDeclaredPermissions(context: Context): Array<out String>? {
        val pm = context.packageManager
        try {
            val packageInfo = pm.getPackageInfo(context.packageName, PackageManager.GET_PERMISSIONS)
            return packageInfo.requestedPermissions ?: return null
        } catch (ignored: PackageManager.NameNotFoundException) {
            //we should always find current app
        }
        throw RuntimeException("cannot find current app?!")
    }
yavor87 commented 6 years ago

Thanks! Try building the project now. It should be alright.