May 26 | 8:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
May 26 | 9:10 AM |
Joshua C. | has entered the room |
Mark M. |
hello, Joshua
|
Mark M. |
how can I help you today?
|
Joshua C. |
Good morning from the west coast. :)
|
Mark M. |
yeesh
|
Mark M. |
and I thought *I* was an early riser
|
Joshua C. |
Well, everything was working well... and all of the a sudden... R (as in the resource object) "cannot be resolved."
|
May 26 | 9:15 AM |
Mark M. |
either a resource or a manifest is malformed, preventing aapt from generating the R class
|
Joshua C. |
Well, I've been working on this program fairly obsessively for weeks now... and I made it a point to get up to ask you this puzzler. :)
|
Mark M. |
you should be getting other build errors that would indicate the source of the problem
|
Mark M. |
what IDE are you using?
|
Joshua C. |
android studio
|
Joshua C. |
newest version.
|
Mark M. |
yes, you definitely should be getting some other build errors first
|
Joshua C. |
This problem started when I tried to use the "add" feature... to add a "SettingsActivity".
|
Mark M. |
either that, or you have an import for the wrong R in that Java class
|
Joshua C. |
Then I deleted the settings activity and now this problem is persisting... the imports didn't change at all, just all of a sudden they wouldn't resolve.
|
Joshua C. |
I'm looking for more errors... it's being slow.
|
Joshua C. |
"Gradle Build Running"
|
Joshua C. |
I've been making very good progress, really...
|
Joshua C. |
I just noticed one thing that might be the problem, actually... so, I split my code into two packages.. to separate the layout part and the program I'm implementing with the layout...
|
May 26 | 9:20 AM |
Mark M. |
at most, one of those Java packages will be the package name in your manifest
|
Joshua C. |
So I have "com.codesolutions.onehandkeyboard" with two classes in it.
|
Mark M. |
in any other Java package, you would need to import the R class
|
Joshua C. |
And I have com.codesolutions.pathlayout
|
Joshua C. |
The package name in the manifest it seems had been changed by android studio to a "com.android.example" one... I've changed it to com.codesolutions.onehandkeyboard and I'll know in a sec if that did anything.
|
Joshua C. |
Right now, this problem is happening in BOTH packages.
|
Mark M. |
the application ID defined in Gradle does not matter; the package attribute in the <manifest> element is what matters
|
Joshua C. |
Currently this is the top of my AndroidManifest.xml file:
|
Joshua C. |
View paste
|
Mark M. |
so, your Java classes in com.codesolutions.onehandkeyboard do not need an import statement for com.codesolutions.onehandkeyboard.R
|
Mark M. |
however, your Java classes in com.codesolutions.pathlayout would need an import statement for com.codesolutions.onehandkeyboard.R
|
May 26 | 9:25 AM |
Joshua C. |
Right, and they had one... It worked for days like this, after I split it into the two packages.
|
Joshua C. |
It was something that android studio did that broke it... this build is taking forever
|
Joshua C. |
It still says building.
|
Joshua C. |
When I first open the project (after restart or a reboot), it opens like everything is fine... and then only when I try to build does it start giving me this problem...
|
Joshua C. |
in the pathlayout package, I do have that import statement, but even in the import statement it says R can't be resolved.
|
Joshua C. |
import com.codesolutions.onehandkeyboard.R;
|
Mark M. |
if the build is still going on, that's not surprising
|
Mark M. |
once the build is over, if that persists, that means that the R class is not being generated, and we're back to trying to find the resource file or manifest entry that is causing that
|
Joshua C. |
Okay, yes, still building... oh, another change I made was changing the minSdk.
|
Joshua C. |
13 is a reasonable minSdk, no?
|
Joshua C. |
That covers most of the devices out there?
|
Mark M. |
well, there are roughly zero devices running API Level 13 or 14
|
Mark M. |
so I'd go with a minSdkVersion of 15, instead of 13
|
Joshua C. |
Okay... it had been set to 1 initially it seems.
|
May 26 | 9:30 AM |
Joshua C. |
View paste
|
Joshua C. |
My program very heavily uses this Path class.
|
Mark M. |
I have never used Path, sorry
|
Joshua C. |
Perhaps you could give my question a bump?
|
Joshua C. |
The documentation for that class is frustratingly sparse.
|
Mark M. |
if you mean an upvote, I have now done that
|
Mark M. |
the documentation for lots of Android is frustratingly sparse
|
Mark M. |
IOW, welcome to my life
|
Joshua C. |
View paste
|
Joshua C. |
IOW?
|
Mark M. |
"in other words"
|
Joshua C. |
Ah.
|
Joshua C. |
This build has taken over 20 minutes...
|
Joshua C. |
View paste
|
Ryan K. | has entered the room |
May 26 | 9:35 AM |
Mark M. |
Joshua: let me take a question from Ryan while your build chugs along
|
Mark M. |
Ryan: hi! how can I help you today?
|
Joshua C. |
Of course, thank you.
|
Ryan K. |
I have met a question about Android Studio,
|
Ryan K. |
Project works well on Eclipse
|
Ryan K. |
but after I import it to Android Studio
|
Ryan K. |
Something strange happened!Installation failed since the APK was either not singed,or signed incorrectly.
|
Mark M. |
what are you doing that is resulting in that message?
|
May 26 | 9:40 AM |
Ryan K. |
the config is right,I have searched a lot about this issue,but I cannot find a solution
|
Mark M. |
what are you doing that is resulting in that message?
|
Ryan K. |
I just run and try to install the programe
|
Mark M. |
do you mean that you are just clicking the "run" icon in Android Studio?
|
Mark M. |
or do you mean something else?
|
Ryan K. |
yes
|
Ryan K. | |
Ryan K. |
this issue is same to mine
|
Mark M. |
try creating a new project, through the Android Studio new-project wizard
|
Mark M. |
then, try running that project
|
Mark M. |
if that runs, then the problem is tied to the build.gradle file of your imported project, where somehow you are changing up how the debug build type is getting its signing information
|
Mark M. |
if that project does not run, then something more generally is wrong, such as not having a debug keystore (and one not being built automatically for some reason)
|
May 26 | 9:45 AM |
Mark M. |
you might also confirm that you are indeed building the debug build variant, in the Build Variants tool, docked by default on the left of the Android Studio window
|
Ryan K. |
ok,thank you,I will try.
|
Mark M. |
let me swing back to Joshua for a bit, and I will return to you before the chat ends
|
Mark M. |
Joshua: anything more on your end?
|
Joshua C. |
View paste
|
Joshua C. |
My browser crashed it seemed.
|
Joshua C. |
android studio is hung now and won't let me copy the errors...
|
Joshua C. |
but they are all "Exception in thread "png-cruncher-##"... and there are lots of them, with various numbers.
|
Joshua C. |
RuntimeException: timeout
|
Mark M. |
sounds like there is a problem with some of your drawable resources
|
Joshua C. |
I'm trying to force quit Android now as it's halted.
|
Joshua C. |
I have absolutely no drawable resources in my app!
|
Mark M. |
sure you do
|
Mark M. |
if nothing else, you have a launcher icon
|
Mark M. |
if you ever get a build going again, look at the paths of what png-cruncher is choking on
|
Joshua C. |
Oh yes, I do, the default one.
|
May 26 | 9:50 AM |
Joshua C. |
Okay, restarting Android Studio now.
|
Mark M. |
if they point to drawables in your project, check them out and see if they have been corrupted (e.g., you cannot open them in a regular image viewer on your development machine)
|
Mark M. |
if either of you have further questions, go right ahead
|
Joshua C. |
So far I can open all the various sizes of the little android alien icon.
|
Joshua C. |
I am attempting to build again... hopefully will have more specific errors in a few minutes.
|
Joshua C. |
Oh... build successful.
|
Mark M. |
meaning your R problem is now gone?
|
Joshua C. |
Trying to run now... we'll see.
|
Joshua C. |
But it seems that way.
|
Joshua C. |
Strange...
|
May 26 | 9:55 AM |
Joshua C. |
Wow, and it runs.
|
Mark M. |
Ryan: do you have another question?
|
May 26 | 10:00 AM |
Joshua C. |
That mess started when I tried to add a Preferences button to my app, and android threw a whole lot of junk in there as a "SettingsActivity"... it's PreferencesFragment I want though, no?
|
Ryan K. |
Do you have any plan to write something about RxJava?
|
Mark M. |
well, you will probably show the preferences via a PreferenceFragment
|
Mark M. |
but whether that is wrapped in a dedicated activity or not would depend upon your app
|
Mark M. |
Ryan: not in the near future, sorry
|
Mark M. |
and that's a wrap for today's chat
|
Mark M. |
the transcript will be posted to http://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is scheduled for 7:30pm US Eastern on Saturday
|
Mark M. |
have a pleasant day!
|
Joshua C. |
Okay, then.
|
Joshua C. | has left the room |
Ryan K. | has left the room |
Mark M. | turned off guest access |