Office Hours — Today, January 23

Yesterday, January 22

Jan 23
8:50 AM
Mark M.
has entered the room
8:55 AM
Mark M.
turned on guest access
9:15 AM
Micalet
has entered the room
Micalet
Good morning
Mark M.
hello, Micalet!
how can I help you today?
Micalet
I hope so
;-)
I have an app that show a notification if there are updates in a rss
when you click in the notification, the news activity is opened
and the notification disappear
but I want to know how to remove the notifications if I open the news activity from the app, and not from the notification
Mark M.
call cancel() or cancelAll() on NotificationManager
cancel() cancels a single Notification, given its ID
cancelAll() cancels all your outstanding Notifications
Micalet
but I have to call it from my news activity or from the service that send the notification?
9:20 AM
Mark M.
from anywhere in your app
Micalet
i have to make any cheking before? for example: if(notificationisshown=true){cancel...}
Mark M.
no, you are welcome to blindly cancel() if you like
Micalet
is ther any problem if I call cancel() and the nofication is not showing?
Mark M.
no, there should be no exceptions raised or anything like that
Micalet
ok
I'm going to try it
thank you
Mark M.
you are very welcome
9:25 AM
Mark M.
if you have other questions, go right ahead
9:30 AM
Partisan
has entered the room
Mark M.
hello, Partisan
Partisan
Hi mark
Mark M.
Partisan: Micalet has already asked a question, so it is your turn -- do you have a question?
Partisan
This is good timing! I just logged onto the site looking for some support and saw your office hours were on
Yes, but it's to do with a technical problem I'm getting with gradle and android studio
Mark M.
OK, go ahead -- with luck, I can help
9:35 AM
Partisan
Thanks - I only started going through your tutorials yesterday, but whenever I try to run anything, even a simple hello world program, on android studio, I get an "Execution failed for task 'app:dexDebug' error in the cradle console
Mark M.
can you post the entire error here? there should be some details after that line
Partisan
Sure, one sec, I'm on my laptop
Micalet
hello again Mark. It works perfect. That was what I need
Mark M.
Micalet: glad to hear it!
Micalet
Thank you again.
Partisan
View paste
FAILURE: Build failed with an exception.


* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
 X:\Android\Android-SDK\build-tools\21.1.2\dx.bat --dex --no-optimize --output X:\Android\HelloWorldAndroid\app\build\intermediates\dex\debug --input-list=X:\Android\HelloWorldAndroid\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
 1


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Micalet
Bye
Mark M.
Partisan: hmmmm... that was less informative than I had hoped... :-(
if you create just a plain new project in Android Studio, does it run?
Partisan
No, same issue - give that I'd only just started with your tutorial I deleted everything I could find to do with android studio, .gradle etc., completely reinstalled, made a hello world program using the New Project tool and it's still the same :/
9:40 AM
Mark M.
is there anything of interest below what you have pasted, such as a message regarding "the system cannot find the specified path" or anything?
Partisan
No, after that it's just BUILD FAILED
Mark M.
can you try copying that command and running it from a command prompt?
Partisan
Do you mean this one? X:\Android\Android-SDK\build-tools\21.1.2\dx.bat --dex --no-optimize --output
9:45 AM
Mark M.
it would be that, continuing on through all of the switches
X:\Android\Android-SDK\build-tools\21.1.2\dx.bat --dex --no-optimize --output X:\Android\HelloWorldAndroid\app\build\intermediates\dex\debug --input-list=X:\Android\HelloWorldAndroid\app\build\intermediates\tmp\dex\debug\inputList.txt
Partisan
Error occurred during initialisation of VM. Could not reserved enough space for 048576KB Object heap
Mark M.
now that's interesting
Partisan
1048576KB**
Mark M.
that's even more interesting, as that's 1TB, and I rather doubt that you have 1TB of RAM :-)
Partisan
Ha ^_^
Mark M.
that seems like the closest match to your problem
if you go into your SDK Manager, what version of "Android SDK Tools" do you have installed?
9:50 AM
Micalet
has left the room
Partisan
Good stuff. I had a search through Stack Overflow, and no-one had the exact issue, especially not from a fresh install
24.0.2
Mark M.
hmmm, in theory, you should already have the fix, per Xav's comment towards the bottom
though there's still people encountering the issue, per the last comment
Partisan
Android SDK Tools: 24.0.2 SDK Platform-Tools: 21 and Build-Tools: 21.1.2
Mark M.
you might double-check in the projects that you are trying and confirm that buildToolsVersion is set to 21.1.2
in a classic Android Studio project, that would be in app/build.gradle
in most of my samples, where I do not have an app/ module to maintain Eclipse compatibility, it would be in the build.gradle in the project root directory
Partisan
Yea, buildToolsVersion "21.1.2" in build.gradle (Module: app)
Mark M.
you might also manually examine the find_java.bat file cited in comment #16 of that issue, to confirm that you indeed have the fixed version
Partisan
What's very strange about this is that yesterday morning, when I first started on your tutorials, it actually ran ok. I only got these issues yesterday evening :/
Mark M.
I have no explanation for that either
you may want to keep an eye on the main issue, into which the one I linked to was merged: https://code.google.com/p/android/issues/detail...
beyond that, I don't have any great ideas
other than to move to Linux :-)
9:55 AM
Partisan
I may actually give your last point a go
Mark M.
we have penguins here. everybody loves penguins. :-)
any last questions?
Partisan
Ah, that's a shame. The line quoted in that answer was actually written differently, but even once amended it hasn't solved the problem
Mark M.
then something else is afoot
10:00 AM
Partisan
No, I think I'm just going to try installing Studio on my Linux partition, hopefully that means I can get back to the good stuff
Mark M.
you could post your own issue, mentioning the relationship to the other ones, and supplying the sort of stuff you posted here, including the results of the manual command run
OK
that's a wrap for today's chat
the transcript will be posted to http://commonsware.com/office-hours/ shortly
the next chat is Tuesday at 7:30pm US Eastern
have a pleasant day!
Partisan
You took!
Too*
Partisan
has left the room
Mark M.
turned off guest access

Yesterday, January 22

 

Office Hours

People in this transcript

  • Mark Murphy
  • Micalet
  • Partisan