Error:java.lang.NullPointerException (no error message) - android

This question have asked for several times and I follow those questions and tried to solve the problem. The project was successfully build and running I shut down my computer few hours ago. This problem is making me mad please help.
Message:
Information:Gradle tasks [:app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2420Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72420Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72420Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2420Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72420Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2420Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2420Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2420Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2420Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2420Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42420Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2420Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders
Error:java.lang.NullPointerException (no error message)
Information:BUILD FAILED
Information:Total time: 1.422 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.0'
defaultConfig {
applicationId "np.com.yipl.yiplandroidlistme"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
Please help .

This is normally a gradle build problem, try updating your gradle version.

I had a problem due to another package having installed which was creating clashes. As I uninstalled it, worked successfully.
I hope it would help someone else.

Just delete the .gradle folder from the project directory. Restart the Android Studio.
Note: .gradle folder is hidden in your Android Project Directory in MacOS. :)

Add ndk.dir in local.properties
ndk.dir=C:\Users\fatsnake\AppData\Local\Android\Sdk\ndk\(version)
enter image description here

Follow the step :
1. Close Your Android Studio
2. Go to YourProjects/.gradle
3. Delete .gradle folder
4. Again open Android Studio
5. Rebuild Your Project.
You are done .

Related

Execution failed for task ':app:mergeDebugResources'

Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
GRADLE CONSOLE OUTPUT:
Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2510Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72510Library UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2510Library UP-TO-DATE
:app:prepareComAndroidVolleyVolley100Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
:app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Can anyone help me in fixing this. I am new to android :(
I have added a screen shot of Android Manifest.
So far I have tried below steps to fix the issue. Still no help.
1) Clean Prjoect
2) Rebuild Project
3) File > Invalid Cache/Restart
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.theaquarious.myfavapp"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
This issue is now resolved. The error was raised due to the image file. I have changed the extension of an JPG image to PNG without using any editor. Due to this android studio started to throw the error. Thanks to everyone who tried to help me. If anyone needs more clarification on this, just comment.
This appears to be a bug in aquiring a lock in some Java thread. I see this on my Windows 7 PC starting recently. I have had success by simply running Task Manager and then killing the java.exe process. If I then try again, the build seems to work fine.
The error is because the names of the files that are saved in your Drawable folder can not be capitalized. Rename the file and leave everything in lowercase.
Don’t save drawable images in capital case and it should be png not jpg else it will throw an error : Execution failed for task ':app:mergeDebugResources'

Execution Failed for task ':app:processDebugResources'

I am getting this error from build-tools\23.0.2\ (Aapt.exe)
finished with non zero exit value 1.
I am using Android Studio Version 1.4.1
I am using the API level 23 with the updated build tools, and my log cat is often meaning out the string.xml where I created my strings to refer it for the list view.
Executing tasks: [:app:generateDebugSources,
:app:generateDebugAndroidTestSources, :app:compileDebugSources,
:app:compileDebugAndroidTestSources, :mylibrary:generateDebugSources,
:mylibrary:generateDebugAndroidTestSources,
:mylibrary:compileDebugSources,
:mylibrary:compileDebugAndroidTestSources]
Configuration on demand is an incubating feature. :app:preBuild
UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig
UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets
UP-TO-DATE :app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE :app:mergeDebugResources
UP-TO-DATE :app:processDebugManifest UP-TO-DATE
:app:processDebugResources AGPBI: { "kind":"error","text":"Apostrophe
not preceded by \ ( in ithin the lifecycle callback methods, you can
declare how your activity behaves when the user leaves and re-enters
the activity. For example, if you\u0027re building a streaming video
player, you might pause the video and terminate the network connection
when the user switches to another app. When the user returns, you can
reconnect to the network and allow the user to resume the video from
the same spot. )", "sources":[
{"file":"C:\Users\PreciseT3\AndroidStudioProjects\ListviewApp1\app\src\main\res\values\strings.xml","position":
{ "startLine":1}}],"original":""}
FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command
'C:\Users\PreciseT3\AppData\Local\Android\sdk\build-tools\23.0.2\aapt.exe''
finished with non-zero exit value 1
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 12.649 secs
Problem is in your string.xml
find all occurrences of single-quote (') or apostrophe and add a back-slash escape character (\) before each occurrence.
XML cannot deal with (')
Basically, replace all ' with \'
Compare your gradle file I hope this work
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "info.tranetech.laundry"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:design:23.0.1'
compile 'com.squareup.picasso:picasso:+'
testCompile 'junit:junit:4.12'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile files('libs/android-async-http-1.4.4.jar')
compile 'com.google.android.gms:play-services:8.4.0'
}

Android studio gradle org.gradle.process.internal.ExecException

My gradle is
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.tbkha"
minSdkVersion 14
targetSdkVersion 23
versionCode 2
versionName "1.0.1"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
maven {
url 'http://swisscodemonkeys.github.io/appbrain-sdk/maven'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.github.nirhart:parallaxscroll:1.0'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.appbrain:appbrain-applift-sdk:10.51'
compile 'com.android.support:multidex:1.0.1'
}
I face this problem:
Information:Gradle tasks [:tbkha:assembleDebug]
:tbkha:preBuild UP-TO-DATE
:tbkha:preDebugBuild UP-TO-DATE
:tbkha:checkDebugManifest
:tbkha:preReleaseBuild UP-TO-DATE
:tbkha:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:tbkha:prepareComAndroidSupportCardviewV72311Library UP-TO-DATE
:tbkha:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:tbkha:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:tbkha:preDebugAndroidTestBuild UP-TO-DATE
:tbkha:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:tbkha:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:tbkha:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:tbkha:prepareComFacebookAndroidFacebookAndroidSdk410Library UP-TO-DATE
:tbkha:prepareComGithubNirhartParallaxscroll10Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServices840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesAds840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesAppstate840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesAuth840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesCast840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesDrive840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesFitness840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesGames840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesIdentity840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesLocation840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesMaps840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesNearby840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesPanorama840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesPlus840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesVision840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesWallet840Library UP-TO-DATE
:tbkha:prepareComGoogleAndroidGmsPlayServicesWearable840Library UP-TO-DATE
:tbkha:prepareDeHdodenhofCircleimageview130Library UP-TO-DATE
:tbkha:prepareDebugDependencies
:tbkha:compileDebugAidl UP-TO-DATE
:tbkha:compileDebugRenderscript UP-TO-DATE
:tbkha:generateDebugBuildConfig UP-TO-DATE
:tbkha:generateDebugAssets UP-TO-DATE
:tbkha:mergeDebugAssets UP-TO-DATE
:tbkha:generateDebugResValues UP-TO-DATE
:tbkha:generateDebugResources UP-TO-DATE
:tbkha:mergeDebugResources UP-TO-DATE
:tbkha:processDebugManifest UP-TO-DATE
:tbkha:processDebugResources UP-TO-DATE
:tbkha:generateDebugSources UP-TO-DATE
:tbkha:compileDebugJavaWithJavac UP-TO-DATE
:tbkha:compileDebugNdk UP-TO-DATE
:tbkha:compileDebugSources UP-TO-DATE
:tbkha:transformClassesWithJarMergingForDebug UP-TO-DATE
:tbkha:collectDebugMultiDexComponents UP-TO-DATE
:tbkha:transformClassesWithMultidexlistForDebug UP-TO-DATE
:tbkha:transformClassesWithDexForDebug
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded
Error:Execution failed for task ':tbkha:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_65\bin\java.exe'' finished with non-zero exit value 3
Information:BUILD FAILED
Information:Total time: 4 mins 38.558 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
Thanks all,
I solved this problem by this steps:
1- add (org.gradle.jvmargs=-Xmx1024m) Inside my_project/gradle/wrapper/gradle-wrapper.properties
2- add (dexOptions { javaMaxHeapSize "4g" }) to build.gradle.
This problem is solved.
It takes a lot of memory to dex all that java code, and considering you have a lot of dependencies it looks likes you need a lot more! Increase the memory available to your Gradle process.
Inside your project/gradle/wrapper/gradle-wrapper.properties
add this line
org.gradle.jvmargs=-Xmx1024m
For instance it could look like this:
See here for more: https://docs.gradle.org/current/userguide/build_environment.html
org.gradle.jvmargs
Specifies the jvmargs used for the daemon process. The setting is particularly useful for tweaking memory settings. At the moment the default settings are pretty generous with regards to memory.

Error:Execution failed for task ':app:processDebugResources'. > at index 4

I having problem while building my project after revision 2 update of the latest SDK(Sorry,I dont remeber the version number).I run the code succesfully before. I dont think there is any error in my project.I often get error message as "IDE internal error occured" is that anything to do with this. please help thanks.Required codes are given below
app/build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "io.sleeko.board"
minSdkVersion 15
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'])
compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
exclude module: 'support-v4'
}
compile 'com.android.support:recyclerview-v7:23.0.1'
compile('com.github.nkzawa:socket.io-client:0.6.0') {
exclude group: 'org.json', module: 'json'
}
// compile project(':Emojicon')
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-plus:8.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
compile 'me.relex:circleindicator:1.1.5#aar'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile 'com.google.code.gson:gson:2.4'
compile 'com.github.rahatarmanahmed:circularprogressview:2.3.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.traex.rippleeffect:library:1.3'
compile 'com.alexbbb:uploadservice:1.4'
compile 'com.github.satyan:sugar:1.3'
compile 'com.mikhaellopez:circularimageview:2.0.2'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
}
Message Gradle Build:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAlexbbbUploadservice14Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72310Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72310Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2310Library UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72310Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42310Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk470Library UP-TO-DATE
:app:prepareComGithubRahatarmanahmedCircularprogressview232Library UP-TO-DATE
:app:prepareComGithubSatyanSugar13Library UP-TO-DATE
:app:prepareComGithubTraexRippleeffectLibrary13Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus810Library UP-TO-DATE
:app:prepareComMikhaellopezCircularimageview202Library UP-TO-DATE
:app:prepareMeRelexCircleindicator115Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources FAILED
Error:Execution failed for task ':app:processDebugResources'.
> at index 4
Information:BUILD FAILED
Information:Total time: 24.365 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
Event log
3:26:52 PM NullPointerException: Failed to set up Android modules in project
On clicking NullPointerException it says to report to google with details as below:
Failed to set up Android modules in project 'bridgewith'
java.lang.NullPointerException
at com.intellij.openapi.util.io.FileUtilRt.toSystemIndependentName(FileUtilRt.java:207)
at com.intellij.openapi.util.io.FileUtil.toSystemIndependentName(FileUtil.java:634)
at org.jetbrains.android.sdk.AndroidSdkUtils.getPlatformDir(AndroidSdkUtils.java:218)
at org.jetbrains.android.sdk.AndroidSdkUtils.getPlatformAndAddOnJars(AndroidSdkUtils.java:122)
at org.jetbrains.android.sdk.AndroidSdkUtils.getLibraryRootsForTarget(AndroidSdkUtils.java:156)
at org.jetbrains.android.sdk.AndroidSdkUtils.setUpSdk(AndroidSdkUtils.java:409)
at org.jetbrains.android.sdk.AndroidSdkUtils.createNewAndroidPlatform(AndroidSdkUtils.java:359)
at org.jetbrains.android.sdk.AndroidSdkUtils.createNewAndroidPlatform(AndroidSdkUtils.java:336)
at org.jetbrains.android.sdk.AndroidSdkUtils.createNewAndroidPlatform(AndroidSdkUtils.java:327)
at org.jetbrains.android.sdk.AndroidSdkUtils.tryToCreateAndroidSdk(AndroidSdkUtils.java:617)
at com.android.tools.idea.gradle.customizer.android.AndroidSdkModuleCustomizer.customizeModule(AndroidSdkModuleCustomizer.java:92)
at com.android.tools.idea.gradle.customizer.android.AndroidSdkModuleCustomizer.customizeModule(AndroidSdkModuleCustomizer.java:48)
at com.android.tools.idea.gradle.service.AndroidGradleModelDataService.customizeModule(AndroidGradleModelDataService.java:330)
at com.android.tools.idea.gradle.service.AndroidGradleModelDataService.access$100(AndroidGradleModelDataService.java:88)
at com.android.tools.idea.gradle.service.AndroidGradleModelDataService$1.run(AndroidGradleModelDataService.java:159)
at com.intellij.openapi.command.WriteCommandAction$Simple.run(WriteCommandAction.java:166)
at com.intellij.openapi.application.RunResult.run(RunResult.java:38)
at com.intellij.openapi.command.WriteCommandAction$2$1.run(WriteCommandAction.java:114)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:931)
at com.intellij.openapi.command.WriteCommandAction$2.run(WriteCommandAction.java:111)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:108)
at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:80)
at com.android.tools.idea.gradle.service.AndroidGradleModelDataService.doImport(AndroidGradleModelDataService.java:136)
at com.android.tools.idea.gradle.service.AndroidGradleModelDataService.importData(AndroidGradleModelDataService.java:122)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager.importData(ProjectDataManager.java:132)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager.importData(ProjectDataManager.java:102)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager.importData(ProjectDataManager.java:141)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager.importData(ProjectDataManager.java:148)
at com.android.tools.idea.gradle.util.Projects$1$1$1.run(Projects.java:130)
at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.mergeRootsChangesDuring(ProjectRootManagerImpl.java:328)
at com.android.tools.idea.gradle.util.Projects$1$1.run(Projects.java:126)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:931)
at com.android.tools.idea.gradle.util.Projects$1.run(Projects.java:122)
at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2369)
at com.android.tools.idea.gradle.util.Projects.populate(Projects.java:115)
at com.android.tools.idea.gradle.project.ProjectSetUpTask$2.run(ProjectSetUpTask.java:113)
at com.intellij.ide.startup.impl.StartupManagerImpl$7.run(StartupManagerImpl.java:369)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:734)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:569)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Try the latest version of Android SDK build tools.
buildToolsVersion "23.0.3"
Good luck.
I had the same problem. Then I tried the solution from issue #195094 and it worked.
My problem likely was caused by the error I got while updating the sdk tools at the same time than Android Studio, trying to get both of them updated without closing AS beforehand. As a result, the SDK manager was marking the package as partially installed. After completely installing it, setting buildtoolsversion to 23.0.2, and then "invalidating caches and restart" the problem disappeared!
I had the same problem and I noticed that Android 6.0 was partially installed. After completing download everything worked. It was hard to figure this because Android 6.0 was working before and then decided to try out the new emulator and downloaded system images and I guess loading those was not completed.
As you may have already found, this error can be visible due to many reasons. Hence you need to find actual reason behind the error.
Navigate to android folder and issue below command;
gradlew --info clean build
This will list the actual issue, rectify that and redo the build.
Hope this is helpful!
Use this :
buildToolsVersion "21.0.1"
You will find this setting inside the file app/build.gradle.
Based off the following log files:
"Failed to set up Android modules in project 'bridgewith'
java.lang.NullPointerException
at com.intellij.openapi.util.io.FileUtilRt.toSystemIndependentName(FileUtilRt.java:207)
at com.intellij.openapi.util.io.FileUtil.toSystemIndependentName(FileUtil.java:634)
at org.jetbrains.android.sdk.AndroidSdkUtils.getPlatformDir(AndroidSdkUtils.java:218)
at org.jetbrains.android.sdk.AndroidSdkUtils.getPlatformAndAddOnJars(AndroidSdkUtils.java:122)
at org.jetbrains.android.sdk.AndroidSdkUtils.getLibraryRootsForTarget(AndroidSdkUtils.java:156)
at org.jetbrains.android.sdk.AndroidSdkUtils.setUpSdk(AndroidSdkUtils.java:409)
at org.jetbrains.android.sdk.AndroidSdkUtils.createNewAndroidPlatform(AndroidSdkUtils.java:359)"
I think it's a problem with your Android Studio/Intellij IDE. Please uninstall Android Studio in your Programs and Features. Here:
Then reinstall Andriod Studio again. Go to Google's Android Studio download site and download and install the IDE.
I had a similar error and the problem came from a corrupt adb.exe file inside my user/android-sdks/platform-tools folder. So I had to delete my platform tools folder and then reinstall platform-tools using SDK Manager.

Execution failed for task ':app:transformClassesWithDexForDebug' while implementing Google sign in for Android

I'm trying to implement Google sign in for Android and I'm following the instructoins via
https://developers.google.com/identity/sign-in/android/start-integrating
But while building the application I'm receiving the following error.
Information:Gradle tasks [:app:generateDebugSources,
:app:generateDebugAndroidTestSources, :app:assembleDebug]
:app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase810Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement810Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus810Library
UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl
UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets
UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE :app:processDebugGoogleServices
No matching client found for package name 'com.questo.rugved.questo'
:app:generateDebugResources :app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE :app:processDebugResources
UP-TO-DATE :app:generateDebugSources UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:generateDebugAndroidTestSources UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE :app:compileDebugNdk
UP-TO-DATE :app:compileDebugSources UP-TO-DATE
:app:transformClassesAndResourcesWithExtractJarsForDebug
:app:transformClassesWithDexForDebug UNEXPECTED TOP-LEVEL EXCEPTION:
Error:Execution failed for task
':app:transformClassesWithDexForDebug'.
com.android.build.transform.api.TransformException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
'/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit
value 2 Information:BUILD FAILED Information:Total time: 1 mins 39.994
secs Information:1 error Information:0 warnings Information:See
complete output in console
My top level gradle is
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:1.4.0-beta3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
My app level gradle is
<pre>
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.questo.rugved.questo"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.+'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-plus:8.1.0'
}
please help.
Maybe this link helps you. link
That helped me:
android {
...
defaultConfig {
...
multiDexEnabled true
}
}
This problem occurs because of multiple inclusion of dependencies. You are including a dependency that is already specified in your build.gradle file. For example:
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-identity:9.0.2'
the above specification of dependency will generate this problem, because play-services includes everything, including play-services-identity, & so, here the same dependency is included for multiple times.
The recommended option is to only include those dependencies that you actually need. If you need play services location & maps, only include these dependencies as:
compile 'com.google.android.gms:play-services-location:9.0.2'
compile 'com.google.android.gms:play-services-maps:9.0.2'
Without including everything with 'com.google.android.gms:play-services:9.0.2'.
In your specific case, I suspect the conflict is arising between google-services of the top level gradle file and play-services-identity & play-services-plus in the app level gradle file. Using only those services that you specifically need resolving multiple inclusion will resolve your issue.
In general, you should not use "multiDexEnabled true" if you don't have a strong & legitimate reason. Using it without knowing the actual problem means that you are bypassing a problem. You are allowing multiple overlapping dependencies yielding a potential source of api conflicts & bigger apk size.
Adding
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g" // 2g should be also OK
}
in with in android in build.gradle works for me.
Had the same problem.
Mine was fixed by setting the JAVA_HOME variable to java 8 jdk
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"

Categories

Resources