I am having an issue with adding custom images to my app. When I do,I get gradle errors. I searched on here and seen the solution to add:
android: {
useNewCruncher false
}
But that didn't help. I am still getting the "non-zero exit value 42 error". Here is my gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
aaptOptions {
useNewCruncher false
}
defaultConfig {
applicationId "net.androidbootcamp.techgadgets"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
}
Here are most of the gradle errors
Error:Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/SlyInstinct/Library/Android/sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 42
:app:mergeDebugResources FAILED
Error:Execution failed for task ':app:mergeDebugResources'. /Users/SlyInstinct/Documents/AppProjects/AndroidStudioProjects/TechGadgets/app/src/main/res/drawable/butler.png: Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/SlyInstinct/Library/Android/sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 42 Here is the main activity Java
package net.androidbootcamp.techgadgets;
import android.app.ListActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class MainActivity extends ListActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String [] tech ={"Self Driving Car", "Bionic Butler", "Jetpack", "Robot Dogs", "Virtual Reality"};
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, tech));
}
protected void onListItemClick(ListView l, View v, int position, long id) {
switch(position){
case 0:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.google.com/selfdrivingcar/")));
break;
case 1:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://en.wikipedia.org/wiki/Artificial_intelligence")));
break;
case 2:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.martinjetpack.com/")));
break;
case 3:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.bostondynamics.com/robot_bigdog.html")));
break;
case 4:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.oculus.com/en-us/")));
break;
}
}
}
Here is the logcat
03-06 19:59:16.970 1296-1296/? E/LocationManagerService: no geocoder provider found
03-06 19:59:16.970 1296-1296/? E/FlpHardwareProvider: Error hw_get_module 'flp': -2
03-06 19:59:16.970 1296-1296/? E/LocationManagerService: FLP HAL not supported
03-06 19:59:16.970 1296-1296/? W/ServiceWatcher: com.google.android.location not found
03-06 19:59:16.970 1296-1296/? E/LocationManagerService: Unable to bind FLP Geofence proxy.
03-06 19:59:16.970 1296-1296/? E/ActivityRecognitionHardware: Error hw_get_module: -2
03-06 19:59:16.970 1296-1296/? E/LocationManagerService: Hardware Activity-Recognition not supported.
03-06 19:59:16.970 1296-1313/? E/GpsLocationProvider: no AGPS interface in set_agps_server
03-06 19:59:16.990 1296-1296/? I/CommonTimeManagementService: No common time service detected on this platform. Common time services will be unavailable.
03-06 19:59:16.990 1296-1296/? I/MmsServiceBroker: Connecting to MmsService
03-06 19:59:16.990 1296-1296/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1750 com.android.server.MmsServiceBroker.tryConnecting:134 com.android.server.MmsServiceBroker.systemRunning:121 com.android.server.SystemServer$2.run:1182 com.android.server.am.ActivityManagerService.systemReady:11326
03-06 19:59:16.990 1296-1331/? I/InputReader: Reconfiguring input devices. changes=0x00000030
03-06 19:59:17.000 1419-1419/? E/SQLiteLog: (283) recovered 30 frames from WAL file /data/data/com.android.providers.media/databases/external.db-wal
User contributions licensed under CC BY-SA 3.0