21 Replies Latest reply on Sep 21, 2016 7:58 PM by taylorh36329959

    Error - No index.html found - Android build issue

    taylorh36329959

      Hi, I'm running into issues building my Android app all of a sudden. I have all web files in the www directory because I use Ionic and this is how they have things. This is where the index.html is. The build has always worked until just this last hour. The build runs fine on iOS. Can someone fix this?

        • 1. Re: Error - No index.html found - Android build issue
          VectorP Level 4

          1. Are you uploading a zip file to PGB?

          2. Do you have both index.html and config.xml in the same directory within that zip file?

          • 2. Re: Error - No index.html found - Android build issue
            taylorh36329959 Level 1

            from github. The reason I suspect this is a PGB error is because I can get it to work if I keep rebuilding the same files. It's not usual behavior.

            • 3. Re: Error - No index.html found - Android build issue
              patricks82391129

              Same for me. This just started happening. iOS builds are ok (same git hub repo). The android build does go through if I put a fake index.html file in the root of the project. However, the index.html file has to be in the www folder. Looks like the build no longer searches subdirectories for the index.html?

              • 4. Re: Error - No index.html found - Android build issue
                jamesb84845843

                I have exactly the same problem, using github and ionic, started sometime last night.

                 

                Thanks taylorh36329959

                for saying works if keep pressing rebuild over and over (about 1 time in 10).

                 

                thanks!

                • 5. Re: Error - No index.html found - Android build issue
                  jamesb84845843 Level 1

                  my mistake, I can't get it to build at all now.

                   

                  maybe the changes that caused this have only just hit all the build servers?

                   

                  ----

                   

                  Also just tried adding empty index.html to root dir. Now builds, but app is broken, so not a solution, even temporary.

                   

                  roll back, roll back ;-) (no, seriously, please roll back)

                  • 6. Re: Error - No index.html found - Android build issue
                    patricks82391129 Level 1

                    This (retry multiple times) worked for a short amount of time, now I can't get it to build anymore. I assume that the breaking change was not yet on all servers and when you hit a server that wasn't updated, it would go through. I'm blocked.

                    • 7. Re: Error - No index.html found - Android build issue
                      taylorh36329959 Level 1

                      I would say you are right. I can still get it through after about 20 tries now lol. But it won't last much longer

                      • 8. Re: Error - No index.html found - Android build issue
                        jamesb84845843 Level 1

                        UPDATE

                         

                        I tried moving my config.xml from / to /www and

                        • the build succeeded
                        • the resulting app runs

                        so ATM this seems to have fixed the problem.

                         

                        However, I'd be really unsurprised to find some unintended consequences or other problems as a result.

                        If I find any, I'll post them.

                         

                        Hope this is helpful

                        • 9. Re: Error - No index.html found - Android build issue
                          VectorP Level 4

                          I tried moving my config.xml from / to /www and ...

                          Oh please! That's the #1 topic of this forum.

                          It's nicely documented in the Getting Started section of the PGB Docs, too.

                           

                          See my initial question at the top of this thread:

                          "Do you have both index.html and config.xml in the same directory within that zip file?"

                          • 10. Re: Error - No index.html found - Android build issue
                            kerrishotts Adobe Community Professional

                            @VectorP: It may be of questionable utility, but I've added an announcement to the group since the issue of project structure keeps coming up so often. If you have suggestions as to wording, let me know and I'll edit it.

                            • 11. Re: Error - No index.html found - Android build issue
                              patricks82391129 Level 1

                              Have you tried this with a GIT deployment? The GIT repository is pointing to the root of the phonegap project, www is one of the subfolders. If I move the config.xml to the www folder, where I have to put it now with this change, the generated android apk does have a version of 1.0.0 and I can't update anymore.

                               

                              This might work for manual zip files, but it does not seem to be working for GIT driven builds. At least not for me. 

                              • 12. Re: Error - No index.html found - Android build issue
                                VectorP Level 4

                                Hi Kerri,

                                 

                                Thanks, but no. I don't think the wording is wrong.

                                In fact, the requirement of having both index and config in the same (root) directory has been:

                                - documented in the Getting Started section as long as I can remember (at least some 4 years)

                                - mentioned in multiple forums, etc (hundreds, even thousands of times)

                                - described in the Announcement at this forum.

                                 

                                Yet, people don't read that. Well, professional developers read the documentation, but PGB isn't really targeted at them in the first place. I guess it's similar to the fact that people hardly ever read the user's manual of their smartphone.

                                 

                                So, the wording of the announcement is not really important (I think it's correct as is, though), because people seem to prefer posting a question immediately instead of reading docs, announcements or the results of the search function of this forum.

                                • 13. Re: Error - No index.html found - Android build issue
                                  patricks82391129 Level 1

                                  I had to explicitly add a versionCode for the android build (on the widget element) incrementing what was showing as a version code in the play store.

                                  • 14. Re: Error - No index.html found - Android build issue
                                    taylorh36329959 Level 1

                                    Firstly, don't be condescending about something that is clearly a new issue. This isn't a run of the mill newbie question. I've been using PGB for over 2 years and never had issues. Something changed and no one was notified. Yes Kerri literally just put an announcement up so don't claim that people are stupid and don't read.

                                     

                                    Secondly, the way that I have been developing apps is an per Cordova and Ionic directory structures which place the config.xml in the root and the index.html along with all other files that get served in the web view in the www directory. This separates things like hooks, configs and resources from the web files which makes sense especially when using Ionic.

                                     

                                    So I get that PGB can go against this and do it differently, but it seems like this wasn't enforced because myself and obviously others in this thread were building it the other way without issue until just today.

                                     

                                    What I want to know is why this changed? Why can't it work both ways for those of us who prefer the other way? And why is it only Android affected?

                                    • 15. Re: Error - No index.html found - Android build issue
                                      VectorP Level 4

                                      Yes Kerri literally just put an announcement up so don't claim that people are stupid and don't read.

                                      Kerri edited the announcement that has been there since August 11. Ryan posted it initially.

                                      You just never noticed it.

                                       

                                      Firstly, don't be condescending about something that is clearly a new issue.

                                      It's not. If you have been around that long, you must have seen the previous forum, too. At that forum, this was the #1 topic, too, with hundreds of posts suggesting to get the files into the correct place.

                                      Also, the PGB Docs have always clearly explained how to place config.xml into the same directory as index.html. Years ago, already.

                                       

                                      What I want to know is why this changed? Why can't it work both ways for those of us who prefer the other way?

                                      Suppose you have this:

                                       

                                      /config.xml

                                      /icon.png

                                      /someDir/index.html

                                      /someDir/config.xml

                                      /someOtherDir/myProject/index.html

                                      /someOtherDir/myProject/config.xml

                                      /separateModule/index.html

                                       

                                      Now, which index.html and which config.xml should Phonegap Build take to build your app?

                                       

                                      ("Work the other way" would imply that you would have a Project Root and within that a /www directory.

                                      But PGB doesn't require - or expect - a /www directory to be present!)

                                      • 16. Re: Error - No index.html found - Android build issue
                                        jorgeu11571040

                                        Yep, agreed. This just started happening.

                                        Until now, I also used a config.xml in local for local devs, and kept the `www/config.xml` for phonegap build, with the production config on it.

                                         

                                        The system started taking into account *first* the one from the root of the zip, instead of the one in www (as it used to be).

                                        My solutions is simple; I'm just removing the one from the root *before* uploading (I work through the api), but it's been annoying for a while, yes.

                                        • 17. Re: Error - No index.html found - Android build issue
                                          Chris W. Griffith Adobe Community Professional

                                          If you were using Phonegap remote build command, it was moving the

                                          config.xml file into the www directory behind the scenes for you, so you

                                          never knew that it was conforming to the PhoneGap Build structure.

                                           

                                          PhoneGap Build's requirement for the config.xml be at the same root level

                                          as the index.html has been in place since the beginning. There is nothing

                                          new about that. In fact, PGB predates the CLIs, so technically the CLIs are

                                          doing it 'wrong' (but for a valid reason).

                                           

                                          Chris

                                           

                                           

                                           

                                          On Wed, Sep 21, 2016 at 8:03 AM, taylorh36329959 <forums_noreply@adobe.com>

                                          • 18. Re: Error - No index.html found - Android build issue
                                            kerrishotts Adobe Community Professional

                                            The PGB docs have always been specific when it comes to the location of index.html and config.xml. They should be at the top level, and this is nothing new. This does make it difficult to use existing CLI projects because index.html and config.xml live in different locations I hope this is something PGB eventually addresses, but for now, this is where we are. I'm surprised the build ever worked with the CLI structure in your cases. I'm only a mod, so if there has been a code change or a bug that has been introduced, I don't know.

                                             

                                            I did put up an announcement today because many people have run into problems regarding where config.xml and index.html should live. The announcement wasn't intended to be condescending, just hopefully another chance that it will help someone if they happen to notice it. I'm not terribly hopeful people will actually see it because announcements are so easy to miss, but it can't hurt, and it might save the one or two who do happen to notice it.

                                             

                                            Note: I did edit it slightly just now to use the phrasing mentioned in the docs (I used root, docs use top level). I switched from "you're asking for trouble" to "you may run into difficulties", since the first phrasing could easily be taken as condescending in tone. That was not my intent, but it could be taken as such. Apologies for that.

                                            • 19. Re: Error - No index.html found - Android build issue
                                              VectorP Level 4

                                              The system started taking into account *first* the one from the root of the zip, instead of the one in www (as it used to be).

                                               

                                              Now, that would be entirely new, indeed!

                                               

                                              You guys might be right, then...perhaps there's another unannounced change in PGB (which has happened all too often in the past, too). So far, PGB never took 'any' config.xml, but rather searched for an index.html first and then expected the config.xml to be there, too....if not, then a default config was used.

                                              • 20. Re: Error - No index.html found - Android build issue
                                                Chris W. Griffith Adobe Community Professional

                                                Read it carefully, PGB is still using the config.xml at the root, but it appears there is a www directory WITHIN the zip file that also contains another config.xml file.

                                                 

                                                Sigh....

                                                 

                                                Chris