Rooting
- By Arun Kanhere
- Smartphones
- 5 Replies
Can someone please tell me how to root Samsung J4 plus on android 9
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
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: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Failed to execute aapt
at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:201)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:82)
at sun.reflect.GeneratedMethodAccessor330.invoke(Unknown Source)
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:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
... 33 more
Caused by: com.android.ide.common.process.ProcessException: Failed to execute aapt
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:867)
at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:194)
... 48 more
Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\TA\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\TA\AppData\Local\Android\Sdk\platforms\android-22\android.jar -M \\?\C:\Users\TA\Documents\Android Full Test\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug -m -J \\?\C:\Users\TA\Documents\Android Full Test\app\build\generated\source\r\debug -F C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package androidfulltest -0 apk --output-text-symbols \\?\C:\Users\TA\Documents\Android Full Test\app\build\intermediates\symbols\debug --no-version-vectors}
at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)
at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:865)
... 49 more
Caused by: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\TA\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\TA\AppData\Local\Android\Sdk\platforms\android-22\android.jar -M \\?\C:\Users\TA\Documents\Android Full Test\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug -m -J \\?\C:\Users\TA\Documents\Android Full Test\app\build\generated\source\r\debug -F C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package com.zebratechnologies.androidfulltest -0 apk --output-text-symbols \\?\C:\Users\TA\Documents\Android Full Test\app\build\intermediates\symbols\debug --no-version-vectors}
at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:74)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:49)
at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:78)
at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:74)
at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
at com.android.build.gradle.internal.process.GradleProcessExecutor$1.run(GradleProcessExecutor.java:60)
Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\TA\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe'' finished with non-zero exit value 1
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:389)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:47)
... 9 more
apply plugin: 'com.android.application'
android {
defaultConfig {
buildToolsVersion '25.0.2'
compileSdkVersion 'Zebra Technologies Corp:EMDK APIs:22'
applicationId "androidfulltest"
minSdkVersion 22
targetSdkVersion 27
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
applicationVariants.all { variant ->
variant.outputs.each { output ->
// def fileName = "${project.name}_${output.baseName}-${variant.versionName}.apk"
//outputFileName = new File(output.outputFile.parent, fileName).getName()
output.outputFile = new File(output.outputFile.parent,
output.outputFile.name.replace("app-release-unsigned", "AndroidFullTest"))
}
}
}
debug {
applicationVariants.all { variant ->
variant.outputs.each { output ->
// def fileName = "${project.name}_${output.baseName}-${variant.versionName}.apk"
// outputFileName = new File(output.outputFile.parent, fileName).getName()
output.outputFile = new File(output.outputFile.parent,
output.outputFile.name.replace("app-debug", "AndroidFullTest"))
}
}
}
}
// productFlavors {
//}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile 'com.android.support.constraint:constraint-layout:2.0.0-beta2'
compile 'com.google.android.things:androidthings:1.0'
compile 'com.android.support:recyclerview-v7:22.1.1'
compile "com.android.support:appcompat-v7:26.0.2"
compile "com.android.support:support-v13:26.0.2"
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="testAct"
android:installLocation="internalOnly"
android:versionCode="1"
android:versionName="1.0" >
<!--uses-sdk
android:minSdkVersion="23"
android:targetSdkVersion="25" /-->
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.BATTERY_STATS"/>
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="com.symbol.emdk.permission.EMDK"/>
<uses-permission android:name="com.google.android.things.permission.MANAGE_INPUT_DRIVERS" />
<uses-permission android:name="com.google.android.things.permission.USE_PERIPHERAL_IO" />
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.front" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
<uses-feature android:name="android.hardware.usb.host" />
<application android:name="testAct.GlobalVars"
android:allowBackup="true"
android:icon="@drawable/zebra_head"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<uses-library android:name="com.symbol.emdk" />
<!-- <uses-library android:name="com.google.android.things.pio" /> -->
<class android:name="testAct.GlobalVars" />
<activity android:name="testAct.SplashMainActivity" android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="testAct.ConfigCheckTestActivity" android:label="@string/str_config_check_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.DisplayTestActivity" android:label="@string/str_display_test_title" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.TouchpanelTestActivity" android:label="@string/str_touchpanel_test_title" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.BacklightTestActivity" android:label="@string/str_backlight_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.ButtonsTestActivity" android:label="@string/str_buttons_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.SDCardTestActivity" android:label="@string/str_sdcard_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.FrontMicrophoneTestActivity" android:label="@string/str_front_microphone_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.RearMicTestActivity" android:label="@string/str_rear_microphone_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.SpeakerTestActivity" android:label="@string/str_speaker_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.MultiTouchTestActivity" android:label="Multi-Touch Test">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.HeadsetTestActivity" android:label="@string/str_headset_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.ScannerTestActivity" android:label="@string/str_scanner_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.CameraFrontTestActivity" android:label="@string/str_camera_front_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.NFCReadTestActivity" android:label="@string/str_nfc_read_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.WiFi2GTestActivity" android:label="@string/str_wifi2g_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.WiFi5GTestActivity" android:label="@string/str_wifi5g_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.BluetoothTestActivity" android:label="@string/str_bluetooth_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.EthernetTestActivity" android:label="@string/str_ethernet_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.USBHostTestActivity" android:label="@string/str_usb_host_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.FailedTestActivity" android:label="@string/str_failed_test_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.LightSensorTestActivity" android:label="@string/str_light_sensor_test_message">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.GSensorTestActivity" android:label="@string/str_g_sensor_test_message">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.CompassTestActivity" android:label="@string/str_compass_test_message">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.CameraBackTestActivity" android:label="**Rear Camera Test**">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="testAct.SerialPortTestActivity" android:label="**Serial Port Test**">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
Starting process 'command 'C:\Users\TA\AppData\Local\Android\Sdk\build-tools\25.0.0\aapt.exe''. Working directory: C:\Users\TA\Documents\Android Full Test\app Command: C:\Users\TA\AppData\Local\Android\Sdk\build-tools\25.0.0\aapt.exe package -f --no-crunch -I C:\Users\TA\AppData\Local\Android\Sdk\platforms\android-22\android.jar -M \\?\C:\Users\TA\Documents\Android Full Test\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug -m -J \\?\C:\Users\TA\Documents\Android Full Test\app\build\generated\source\r\debug -F C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package com.zebratechnologies.androidfulltest -0 apk --output-text-symbols \\?\C:\Users\TA\Documents\Android Full Test\app\build\intermediates\symbols\debug --no-version-vectors
Successfully started process 'command 'C:\Users\TA\AppData\Local\Android\Sdk\build-tools\25.0.0\aapt.exe''
AGPBI: {"kind":"error","text":"Attribute \"android:alpha\" has already been defined","sources":[{"file":"C:\\Users\\TA\\Documents\\Android Full Test\\app\\build\\intermediates\\res\\merged\\debug\\values\\values.xml","position":{"startLine":644}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Attribute \"android:translationX\" has already been defined","sources":[{"file":"C:\\Users\\TA\\Documents\\Android Full Test\\app\\build\\intermediates\\res\\merged\\debug\\values\\values.xml","position":{"startLine":687}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Attribute \"android:translationY\" has already been defined","sources":[{"file":"C:\\Users\\TA\\Documents\\Android Full Test\\app\\build\\intermediates\\res\\merged\\debug\\values\\values.xml","position":{"startLine":687}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Attribute \"android:translationZ\" has already been defined","sources":[{"file":"C:\\Users\\TA\\Documents\\Android Full Test\\app\\build\\intermediates\\res\\merged\\debug\\values\\values.xml","position":{"startLine":687}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027android:TextAppearance.Material.Widget.Button.Inverse\u0027.","sources":[{"file":"C:\\Users\\TA\\Documents\\Android Full Test\\app\\build\\intermediates\\res\\merged\\debug\\values-v23\\values-v23.xml","position":{"startLine":3}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027android:Widget.Material.Button.Colored\u0027.","sources":[{"file":"C:\\Users\\TA\\Documents\\Android Full Test\\app\\build\\intermediates\\res\\merged\\debug\\values-v23\\values-v23.xml","position":{"startLine":33}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027android:TextAppearance.Material.Widget.Button.Borderless.Colored\u0027.","sources":[{"file":"C:\\Users\\TA\\Documents\\Android Full Test\\app\\build\\intermediates\\res\\merged\\debug\\values-v24\\values-v24.xml","position":{"startLine":2}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027android:TextAppearance.Material.Widget.Button.Colored\u0027.","sources":[{"file":"C:\\Users\\TA\\Documents\\Android Full Test\\app\\build\\intermediates\\res\\merged\\debug\\values-v24\\values-v24.xml","position":{"startLine":3}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027android:keyboardNavigationCluster\u0027.","sources":[{"file":"C:\\Users\\TA\\Documents\\Android Full Test\\app\\build\\intermediates\\res\\merged\\debug\\values-v26\\values-v26.xml","position":{"startLine":14,"startColumn":20,"startOffset":832,"endColumn":53,"endOffset":865}}],"original":"","tool":"AAPT"}
C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug\values\values.xml:645: error: Attribute "android:alpha" has already been defined
C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug\values\values.xml:688: error: Attribute "android:translationX" has already been defined
C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug\values\values.xml:688: error: Attribute "android:translationY" has already been defined
C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug\values\values.xml:688: error: Attribute "android:translationZ" has already been defined
C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
C:\Users\TA\Documents\Android Full Test\app\build\intermediates\res\merged\debug\values-v26\values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
:app:processDebugResources FAILED
:app:processDebugResources (Thread[Task worker for ':',5,main]) completed. Took 0.576 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_custom__camera );
//Flash
hasFlash = getApplicationContext().getPackageManager()
.hasSystemFeature( PackageManager.FEATURE_CAMERA_FLASH);
if (!hasFlash) {
// device doesn't support flash
// Show alert message and close the application
AlertDialog alert = new AlertDialog.Builder(Custom_CameraActivity.this)
.create();
alert.setTitle("Error");
alert.setMessage("Sorry, your device doesn't support flash light!");
alert.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// closing the application
finish();
}
});
alert.show();
return;
}
getWindow().addFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON );
context = this;
mCamera = Camera.open();
mCamera.setDisplayOrientation( 90 );
camerapreview = (LinearLayout) findViewById( R.id.camera_preview );
mCameraPreview = new CameraPreview( context, mCamera );
camerapreview.addView( mCameraPreview );
capture = (ImageButton) findViewById( R.id.button_capture );
capture.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
mCamera.takePicture( null, null, mPicture );
}
} );
switchCamera = (ImageButton) findViewById(R.id.btnSwitch);
switchCamera.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//get the number of cameras
int camerasNumber = Camera.getNumberOfCameras();
if (camerasNumber > 1) {
//release the old camera instance
//switch camera, from the front and the back and vice versa
releaseCamera();
chooseCamera();
} else {
}
}
});
flash= (ImageButton)findViewById( R.id.bulb ) ;
flash.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
if(isFlashOn){
turnOffFlash();
}else{
turnOnFlash();
}
}
} );
mCamera.startPreview();
//initializeCamera();
}
private void turnOnFlash() {
if (isFlashOn) {
if (mCamera != null || params != null) {
return;
}
params = mCamera.getParameters();
params.setFlashMode( Camera.Parameters.FLASH_MODE_OFF);
mCamera.setParameters(params);
mCamera.stopPreview();
isFlashOn = false;
}
}
private void turnOffFlash() {
if(!isFlashOn) {
if (mCamera == null || params == null) {
return;
}
params = mCamera.getParameters();
((Camera.Parameters) params).setFlashMode( Camera.Parameters.FLASH_MODE_TORCH);
mCamera.setParameters(params);
mCamera.startPreview();
isFlashOn = true;
}
}
private void initializeCamera() {
int cameraId= findBackFacingCamera();
if(cameraId >= 0){
mCamera= Camera.open(cameraId);
mCamera.setDisplayOrientation( 180 );
mPicture=getPictureCallBack();
mCameraPreview.refreshCamera( mCamera );
}
}
private int findFrontFacingCamera() {
int cameraId = -1;
// Search for the front facing camera
int numberOfCameras = Camera.getNumberOfCameras();
for (int i = 0; i < numberOfCameras; i++) {
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(i, info);
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
cameraId = i;
cameraBack = false;
break;
}
}
return cameraId;
}
private int findBackFacingCamera() {
int cameraId = -1;
//Search for the back facing camera
//get the number of cameras
int numberOfCameras = Camera.getNumberOfCameras();
//for every camera check
for (int i = 0; i < numberOfCameras; i++) {
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(i, info);
if (info.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
cameraId = i;
cameraBack = true;
break;
}
}
return cameraId;
}
@Override
protected void onResume() {
super.onResume();
if(mCamera== null){
mCamera = Camera.open();
mCamera.setDisplayOrientation( 90 );
mPicture= getPictureCallBack();
mCameraPreview.refreshCamera(mCamera);
Log.d("nu","null");
}else{
Log.d("nu","no null");
}
}
public void chooseCamera() {
//if the camera preview is the front
if (cameraBack) {
int cameraId = findFrontFacingCamera();
if (cameraId >= 0) {
//open the backFacingCamera
//set a picture callback
//refresh the preview
mCamera = Camera.open(cameraId);
mCamera.setDisplayOrientation(90);
mPicture = getPictureCallBack();
mCameraPreview.refreshCamera(mCamera);
}
} else {
int cameraId = findBackFacingCamera();
if (cameraId >= 0) {
//open the backFacingCamera
//set a picture callback
//refresh the preview
mCamera = Camera.open(cameraId);
mCamera.setDisplayOrientation(90);
mPicture = getPictureCallBack();
mCameraPreview.refreshCamera(mCamera);
}
}
}
@Override
protected void onPause() {
super.onPause();
releaseCamera();
}
private void releaseCamera() {
if(mCamera != null){
mCamera.stopPreview();
mCamera.setPreviewCallback( null );
mCamera.release();
mCamera= null;
}
}
private Camera.PictureCallback getPictureCallBack() {
Camera.PictureCallback picture = new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
bitmap = BitmapFactory.decodeByteArray( data,0,data.length );
Intent intent= new Intent(Custom_CameraActivity.this,Display.class);
startActivity( intent );
}
};
return picture;
}
}
public class CameraPreview extends SurfaceView implements
SurfaceHolder.Callback {
private SurfaceHolder mHolder;
private Camera mCamera;
// Constructor that obtains context and camera
@SuppressWarnings("deprecation")
public CameraPreview(Context context, Camera camera) {
super(context);
this.mCamera = camera;
this.mHolder = this.getHolder();
this.mHolder.addCallback(this);
this.mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
try {
// create the surface and start camera preview
if (mCamera == null) {
mCamera.setPreviewDisplay(holder);
mCamera.startPreview();
}
} catch (IOException e) {
Log.d(VIEW_LOG_TAG, "Error setting camera preview: " + e.getMessage());
}
}
public void refreshCamera(Camera camera){
if(mHolder.getSurface()== null){
return;
}
try{
mCamera.stopPreview();
}catch (Exception e){
}
setCamera(camera);
try{
mCamera.setPreviewDisplay( mHolder );
mCamera.startPreview();
}catch (Exception e){
Log.d(VIEW_LOG_TAG,"Error Starting camera preview: " +e.getMessage());
}
}
private void setCamera(Camera camera) {
mCamera = camera;
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
}
@Override
public void surfaceChanged(SurfaceHolder Holder, int format,
int width, int height) {
// start preview with new settings
refreshCamera( mCamera );
}
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_display );
image = findViewById( R.id.imageView );
scancode=findViewById( R.id.scan );
scancode.setOnClickListener( this );
image.setImageBitmap( Custom_CameraActivity.bitmap);
saveImage(Custom_CameraActivity.bitmap);
private String saveImage(Bitmap mybitmap) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream( );
mybitmap.compress( Bitmap.CompressFormat.JPEG,90,bytes );
File file= new File( Environment.getExternalStorageDirectory() + IMAGE_DIRECTORY );
if(!file.exists() ){
Log.d("dirrrrrr","" + file.mkdirs());
file.mkdirs();
}
try{
File f = new File( file, Calendar.getInstance().getTimeInMillis() + ".jpg");
f.createNewFile();
FileOutputStream fo = new FileOutputStream( f );
fo.write( bytes.toByteArray() );
MediaScannerConnection.scanFile( this,new String[]{f.getPath()} ,
new String[]{"image/jpeg"},null);
fo.close();
Log.d( "TAG","File Saved:: ---- " + f.getAbsolutePath() );
return f.getAbsolutePath();
}catch(IOException e1){
e1.printStackTrace();
}
return "";
}