Skip to content

When compiling it has many bugs #1

@staFF6773

Description

@staFF6773

Hi I'm staFF6773 and I've been testing this template of this project to adapt a visual novel of tyrano builder to android I think the code is very good but I've seen that the bug has too many errors when passing the app to apk for example when you enter your visual novel you get the message of access denied to save files and load them or ask you the question if you want to save also I noticed that the audio of the game is stuck and I followed all the steps you showed to adapt your visual novel

private boolean checkPermission() {
        int result = ContextCompat.checkSelfPermission(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE);
        return result == PackageManager.PERMISSION_GRANTED;
    }

    private void requestPermission() {

        if (ActivityCompat.shouldShowRequestPermissionRationale(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
            AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
            alertDialogBuilder
                    .setTitle("Permissão para SAVE")
                    .setMessage("o jogo precisa de permissão para salvar e ler os saves")
                    .setCancelable(false)
                    .setPositiveButton("SIM",
                            (dialog, id) -> {
                                Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                                Uri uri = Uri.fromParts("package", getPackageName(), null);
                                intent.setData(uri);
                                startActivity(intent);
                            })

                    .setNegativeButton("NÃO", (dialog, id) -> dialog.cancel());

            AlertDialog alertDialog = alertDialogBuilder.create();
            alertDialog.show();
        } else {
            ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);
        }
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        if (requestCode == PERMISSION_REQUEST_CODE) {
            if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                Log.e("value", "Permission Granted, Now you can use local drive .");
            } else {
                Toast.makeText(this, "Permissão de acesso negado, você não pode salvar e nem carregar", Toast.LENGTH_LONG).show();
                Log.e("value", "Permission Denied, You cannot use local drive .");
            }
        }
    }

The game ignores the permissions conditions and jumps you at once

Toast.makeText(this, "Permissão de acesso negado, você não pode salvar e nem carregar", Toast.LENGTH_LONG).show();```

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions