• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

App Inventor building first app #HelpNeeded#

hi all hoping someone can help me, after trying to work on this for 2 days frustrated isnt the word lol.

this is my first attempt at creating an app and im trying to compile a feedback form i seen on youtube

instead of the two text inputs i have 13 and the design side of things has seemed to go fine but having trouble with the coding
this is as follows:

package com.example.bf1;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.renderscript.Sampler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final EditText edit1=(EditText) findViewById(R.id.edit1);
final EditText edit2=(EditText) findViewById(R.id.edit2);
EditText edit3=(EditText) findViewById(R.id.edit3);
EditText edit4=(EditText) findViewById(R.id.edit4);
EditText edit5=(EditText) findViewById(R.id.edit5);
EditText edit6=(EditText) findViewById(R.id.edit6);
EditText edit7=(EditText) findViewById(R.id.edit7);
EditText edit8=(EditText) findViewById(R.id.edit8);
EditText edit9=(EditText) findViewById(R.id.edit9);
EditText edit10=(EditText) findViewById(R.id.edit10);
EditText edit11=(EditText) findViewById(R.id.edit11);
EditText edit12=(EditText) findViewById(R.id.edit12);
EditText edit13=(EditText) findViewById(R.id.edit13);
Button button=(Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@override
public void onClick(View v) {
Intent i=new Intent(Intent.ACTION_SEND);
i.setType("message/html");
i.putExtra(Intent.EXTRA_EMAIL.new String(original: "######@gmail.com"));
i.putExtra(Intent.EXTRA_SUBJECT, "Feedback from app");
i.putExtra(Intent.EXTRA_TEXT, "Name"+edit1.getText()+"\n Message:"+edit2.getText());
try {
startActivity(Intent.createChooser(i. title: "Please select Email"));
}
catch (android.content.ActivityNotFoundException ex)
(
Toast.makeText(Context: MainActivity.this. "There are no email clients", Toast.LENGTH_SHORT);

}
});

}
}


if anybody could have a look at at this and maybe tell me where im going wrong id be very appreciative
hope someone can help and thanks in advance :)
 
I'm not currently at home but receive roughly 9 errors, does the code look alright to you ? Thanks for the reply can update further in about half hour
 
Errors I'm receiving are:
Android/lint/correctness/ calling new methods on older versions

Also 9 general errors:
Mainly missing ; or ) - which I should be able to sort
Unexpected token is 1 that is bugging me as I'm unable to copy the code exactly as stated in the video :(
Thanks for your help
 
Errors I'm receiving are:
Android/lint/correctness/ calling new methods on older versions

That would indicate to me that you're using older versions of some libraries. Check your gradle file to make sure you're using the most recent version of any dependencies.

Unexpected token is 1 that is bugging me as I'm unable to copy the code exactly as stated in the video :(

https://stackoverflow.com/questions/40431263/unexpected-token

You've probably got an extra curly brace or parenthesis somewhere. It's difficult to tell because your code is inline-text. Try adding CODE tags - put [ code ] before the code, leaving out the spaces, and [ /code ] after, also leaving out the spaces. That will make it easier to read and spot problems.
 
Thanks for your input James and tony, I did start the project highlighting to use the earliest version of android available as I thought it might 1 help me run into less problems and 2 be compatible with more devices, I'll double check through the code again later when the kids go to bed and will return with feedback.
Thanks again guys for the help
 
Code:
package com.example.bf1;


import android.content.ActivityNotFoundException;

import android.content.Context;

import android.content.Intent;

import android.renderscript.Sampler;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

import android.widget.EditText;

import android.widget.Toast;


public class MainActivity extends AppCompatActivity {


@override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

final EditText edit1=(EditText) findViewById(R.id.edit1);

final EditText edit2=(EditText) findViewById(R.id.edit2);

EditText edit3=(EditText) findViewById(R.id.edit3);

EditText edit4=(EditText) findViewById(R.id.edit4);

EditText edit5=(EditText) findViewById(R.id.edit5);

EditText edit6=(EditText) findViewById(R.id.edit6);

EditText edit7=(EditText) findViewById(R.id.edit7);

EditText edit8=(EditText) findViewById(R.id.edit8);

EditText edit9=(EditText) findViewById(R.id.edit9);

EditText edit10=(EditText) findViewById(R.id.edit10);

EditText edit11=(EditText) findViewById(R.id.edit11);

EditText edit12=(EditText) findViewById(R.id.edit12);

EditText edit13=(EditText) findViewById(R.id.edit13);

Button button=(Button) findViewById(R.id.button);

button.setOnClickListener(new View.OnClickListener() {

@override

public void onClick(View v) {

Intent i=new Intent(Intent.ACTION_SEND);

i.setType("message/html");

i.putExtra(Intent.EXTRA_EMAIL.new String(original: "######@gmail.com"));

i.putExtra(Intent.EXTRA_SUBJECT, "Feedback from app");

i.putExtra(Intent.EXTRA_TEXT, "Name"+edit1.getText()+"\n Message:"+edit2.getText());

try {

startActivity(Intent.createChooser(i. title: "Please select Email"));

}

catch (android.content.ActivityNotFoundException ex)

(

Toast.makeText(Context: MainActivity.this. "There are no email clients", Toast.LENGTH_SHORT);


}

});


}

}

Is this any better ?
Thanks again
 
Here's the token problem, I think:
Code:
try { 
    startActivity(Intent.createChooser(i. title: "Please select Email")); 
} 
catch (android.content.ActivityNotFoundException ex) 
( 
Toast.makeText(Context: MainActivity.this. "There are no email clients", Toast.LENGTH_SHORT);

You have an opening parenthesis after the catch, not a curly brace, and you don't have a closing match. You need this:
Code:
catch (android.content.ActivityNotFoundException ex) {
    Toast.makeText(Context: MainActivity.this. "There are no email clients", Toast.LENGTH_SHORT);
}

Just curious - was there a copy/paste problem that broke indentation? It's indented in your working code, right?
 
Thanks for your input tony, I will adjust these later and this was copied directly from the code as stated I have tried to copy this code from the YouTube video as I have no prior knowledge of coding. Some of the code I was unable to produce as it seems in the video some of the commands auto pop up which I was unable to reproduce. This has been a big learning curve but I'm happy to give it a try especially with good people like yourself on this forum who don't mind helping out
 
I have no prior knowledge of coding

If I may: consider taking a step back from Android and learning to work with basic Java coding first. I am a programmer by trade (for a couple decades), and I've often found myself struggling with Android coding. There's a lot of new material to learn, even if you're moderately competent with Java.

If you learn the basics of Java first, then you'll only be facing the new Android stuff, instead of facing both at once. It might seem counter-intuitive, but it would likely be a faster way to get where you want to be in the end.
 
Grateful for your input tony, it's not something I want to get too deep into tbh. I just wanted a simple feedback form to help cut down paperwork for my business and thought a simple form would do the job. I don't mind having a bash at most things so I thought I would attempt it lol
 
Grateful for your input tony, it's not something I want to get too deep into tbh. I just wanted a simple feedback form to help cut down paperwork for my business and thought a simple form would do the job. I don't mind having a bash at most things so I thought I would attempt it lol

Fair enough - hopefully this will get you through to something somewhat viable.
 
hi tony, i decided to go an easier route (or so i thought lol) and just email it to myself and have rewritten the code

Code:
package com.example.blueflametest1;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.example.blueflametest1.R;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ((Button) findViewById(R.id.btnOK)).setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                String box1 = ((EditText)findViewById(R.id.edit1)).getText().toString();
                String box2 = ((EditText)findViewById(R.id.edit2)).getText().toString();
                String box3 = ((EditText)findViewById(R.id.edit3)).getText().toString();
                String box4 = ((EditText)findViewById(R.id.edit4)).getText().toString();
                String box5 = ((EditText)findViewById(R.id.edit5)).getText().toString();
                String box6 = ((EditText)findViewById(R.id.edit6)).getText().toString();
                String box7 = ((EditText)findViewById(R.id.edit7)).getText().toString();
                String box8 = ((EditText)findViewById(R.id.edit8)).getText().toString();
                String box9 = ((EditText)findViewById(R.id.edit9)).getText().toString();
                String box10 = ((EditText)findViewById(R.id.edit10)).getText().toString();
                String box11 = ((EditText)findViewById(R.id.edit11)).getText().toString();
                String box12 = ((EditText)findViewById(R.id.edit12)).getText().toString();
                String box13 = ((EditText)findViewById(R.id.edit13)).getText().toString();
                Intent mail = new Intent(Intent.ACTION_SEND);
                mail.setType("message/rfc822");
                startActivity(Intent.createChooser(mail, "Send email via:"));
            }
        });
    }
}

im now getting 1 error which is app;mergedebugresources

as you have been so helpful any chance you could have a quick look over the code and see if you find anything wrong ?
i have read a few posts stating it could be a corrupted image or my gradle is not up to date but i updated everything this morning before starting, i managed to get a simple email code working but since i have edited it, it seems to have gone downhill.
thanks in advance
 
Thanks for the reply, gradle build I'm using is 3.4.1
Please run the build and provide the build log. Looks like this error can point to a lot of possible problems. Common ones seem to be build path too long and a conflict with PNG/JPG - but looks like there's plenty of others.

This may help some: https://stackoverflow.com/questions...mergedebugresources-crunching-cruncher-png-fa - if not, like I said, provide the build output so we can try to narrow it down.
 
thanks for the quick reply, ive just looked at that link and seems to talk about corrupt image. here is a copy of the error log. thank you so much for all your help

Code:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:95)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:119)
    at org.gradle.api.internal.tasks.execution.ResolvePreviousStateExecuter.execute(ResolvePreviousStateExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:93)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:45)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:94)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:56)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:67)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
    at org.gradle.execution.plan.DefaultPlanExecutor.process(DefaultPlanExecutor.java:74)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.executeWithServices(DefaultTaskExecutionGraph.java:178)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.execute(DefaultTaskExecutionGraph.java:154)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:41)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:40)
    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:24)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:46)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:49)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:40)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:33)
    at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:383)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:247)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:159)
    at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:134)
    at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:58)
    at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:55)
    at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:82)
    at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:75)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:183)
    at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:75)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:55)
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:54)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:58)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:49)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:46)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
    at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:81)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.ide.common.workers.WorkerExecutorException: 8 exceptions were raised by workers:
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1-5326820-windows Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1-5326820-windows Daemon #1: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1-5326820-windows Daemon #2: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1-5326820-windows Daemon #3: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1-5326820-windows Daemon #4: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1-5326820-windows Daemon #5: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1-5326820-windows Daemon #6: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1-5326820-windows Daemon #7: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.

    at com.android.ide.common.workers.ExecutorServiceAdapter.await(ExecutorServiceAdapter.kt:62)
    at com.android.ide.common.workers.ExecutorServiceAdapter.close(ExecutorServiceAdapter.kt:69)
    at com.android.build.gradle.internal.aapt.WorkerExecutorResourceCompilationService.close(WorkerExecutorResourceCompilationService.kt:67)
    at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:268)
    at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:47)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:284)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:273)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:258)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:67)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:145)
    at org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:49)
    at org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)
    at org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)
    at org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)
    at org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:33)
    at org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)
    at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:43)
    at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:29)
    at org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:134)
    at org.gradle.internal.execution.impl.steps.CacheStep.lambda$execute$3(CacheStep.java:83)
    at java.util.Optional.orElseGet(Optional.java:267)
    at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:82)
    at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:36)
    at org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)
    at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)
    at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)
    at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
    at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
    at java.util.Optional.map(Optional.java:215)
    at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
    at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
    at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:91)
    ... 123 more
Caused by: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1-5326820-windows Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
    at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
    at com.android.ide.common.workers.ExecutorServiceAdapter.await(ExecutorServiceAdapter.kt:56)
    ... 168 more
Caused by: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.1-5326820-windows Daemon #0: Daemon startup failed
This should not happen under normal circumstances, please file an issue if it does.
    at com.android.builder.internal.aapt.v2.Aapt2Daemon.handleError(Aapt2Daemon.kt:148)
    at com.android.builder.internal.aapt.v2.Aapt2Daemon.checkStarted(Aapt2Daemon.kt:57)
    at com.android.builder.internal.aapt.v2.Aapt2Daemon.compile(Aapt2Daemon.kt:79)
    at com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.compile(Aapt2DaemonManager.kt:170)
    at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:37)
    at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:28)
    at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon(Aapt2DaemonManagerService.kt:71)
    at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon$default(Aapt2DaemonManagerService.kt:69)
    at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable.run(Aapt2CompileWithBlameRunnable.kt:34)
    at com.android.ide.common.workers.ExecutorServiceAdapter$submit$submission$1.run(ExecutorServiceAdapter.kt:40)
    at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.internal.aapt.v2.Aapt2InternalException: Failed to start AAPT2 process.
    at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.stopQuietly(Aapt2DaemonImpl.kt:127)
    at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.startProcess(Aapt2DaemonImpl.kt:114)
    at com.android.builder.internal.aapt.v2.Aapt2Daemon.checkStarted(Aapt2Daemon.kt:53)
    ... 13 more
Caused by: java.io.IOException: Process unexpectedly exit.
    at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.startProcess(Aapt2DaemonImpl.kt:115)
    ... 14 more
 
I won't be able to look at this any more for a couple days. Hopefully in the meantime someone else might have a thought, or you might be able to figure something out. I'll check back in Wednesday
 
This looks like a really tough one to track down, I don't know how much more help I can be. I'm not seeing Just shooting out a few things to try from looking this up:
  • Make sure that all your images are good, no corrupt files
  • Maybe try removing all images to be sure it's not a bad image?
  • Make sure that your build paths aren't too long - put your root project file as high in the file hierarchy as you can (Shortening the project name might help)
  • Make sure your drawables (images) are all in the drawables folder
  • Run Build->Clean on your project
Hopefully something on this list will help
 
Thanks for the help tony, I have tried to clean build and a few other things, but haven't had chance to get on it today. I will remove the image tomorrow and the other things you suggested and will come back to you.
Thanks again for all your help with this
 
Hi tony I tried the things above to no avail, I have also tried the following:
Clean project
Changed vm options to Xmx512m
Changed jvmargs to Xmx1024m
Checked use embedded Jdk box
Tried restart as it might be a ram problem
Shortened file name
Tried removing image
Imported image through drawable importer
Deleted and reinstalled gradle

Pulling my hair out lol but will hopefully be all worth it once it's finished.
Anymore pointers from yourself or anyone else ?
Thanks in advance
 
Hi tony, great news I've finally got passed the build error and managed to get it installed on my tablet .. woo hoo!!!
I downgraded the gradle and it finally built without problem.
Looks how I want it to but unfortunately the information I type into the boxes doesn't seem to import into the email.
When I fill out the form, click send back button the email app opens but it's blank :(
1 step at a time, would you have any ideas on this ?
Thanks again for your time I'm very grateful
 
Back
Top Bottom