Android Studio-Classes can not be instantiated












0















I'm using Ubuntu 14.04, I've started to delve into app development and I'm following some online tutorials and I've come across this rendering issue. Whenever I select any theme other than AppTheme.NoActionBar I get an error along the following lines.




The following classes could not be instantiated: -
android.support.design.widget.CoordinatorLayout (Open Class, Show
Exception, Clear Cache) - android.support.design.widget.AppBarLayout
(Open Class, Show Exception, Clear Cache) Tip: Use View.isInEditMode()
in your custom views to skip code or show sample data when shown in
the IDE Exception Details



java.lang.IllegalArgumentException: You need to use a Theme.AppCompat
theme (or descendant) with the design library. at
android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)
at
android.support.design.widget.CoordinatorLayout.(CoordinatorLayout.java:178)
at
android.support.design.widget.CoordinatorLayout.(CoordinatorLayout.java:172)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at
android.view.LayoutInflater.inflate(LayoutInflater.java:394) Copy
stack to clipboard




My grasp is I need to use a Theme.AppCompat. Which I'm unsure of what that is or how to do this. As I said I am brand new to Android Studio and the interface is very foreign to me.



One user mentioned




All you need to do is add android:theme="@style/Theme.AppCompat.Light"
to your application tag in the AndroidManifest.xml file.




But I only seem to have a MainActivity.java, content_main.xml and an activity_main.xml,is this a different file I need to add?



If anyone has any input or help it would be greatly appreciated thank you, I am very new to Android Studio and app development!










share|improve this question



























    0















    I'm using Ubuntu 14.04, I've started to delve into app development and I'm following some online tutorials and I've come across this rendering issue. Whenever I select any theme other than AppTheme.NoActionBar I get an error along the following lines.




    The following classes could not be instantiated: -
    android.support.design.widget.CoordinatorLayout (Open Class, Show
    Exception, Clear Cache) - android.support.design.widget.AppBarLayout
    (Open Class, Show Exception, Clear Cache) Tip: Use View.isInEditMode()
    in your custom views to skip code or show sample data when shown in
    the IDE Exception Details



    java.lang.IllegalArgumentException: You need to use a Theme.AppCompat
    theme (or descendant) with the design library. at
    android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)
    at
    android.support.design.widget.CoordinatorLayout.(CoordinatorLayout.java:178)
    at
    android.support.design.widget.CoordinatorLayout.(CoordinatorLayout.java:172)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

    at
    android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at
    android.view.LayoutInflater.inflate(LayoutInflater.java:394) Copy
    stack to clipboard




    My grasp is I need to use a Theme.AppCompat. Which I'm unsure of what that is or how to do this. As I said I am brand new to Android Studio and the interface is very foreign to me.



    One user mentioned




    All you need to do is add android:theme="@style/Theme.AppCompat.Light"
    to your application tag in the AndroidManifest.xml file.




    But I only seem to have a MainActivity.java, content_main.xml and an activity_main.xml,is this a different file I need to add?



    If anyone has any input or help it would be greatly appreciated thank you, I am very new to Android Studio and app development!










    share|improve this question

























      0












      0








      0








      I'm using Ubuntu 14.04, I've started to delve into app development and I'm following some online tutorials and I've come across this rendering issue. Whenever I select any theme other than AppTheme.NoActionBar I get an error along the following lines.




      The following classes could not be instantiated: -
      android.support.design.widget.CoordinatorLayout (Open Class, Show
      Exception, Clear Cache) - android.support.design.widget.AppBarLayout
      (Open Class, Show Exception, Clear Cache) Tip: Use View.isInEditMode()
      in your custom views to skip code or show sample data when shown in
      the IDE Exception Details



      java.lang.IllegalArgumentException: You need to use a Theme.AppCompat
      theme (or descendant) with the design library. at
      android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)
      at
      android.support.design.widget.CoordinatorLayout.(CoordinatorLayout.java:178)
      at
      android.support.design.widget.CoordinatorLayout.(CoordinatorLayout.java:172)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

      at
      android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at
      android.view.LayoutInflater.inflate(LayoutInflater.java:394) Copy
      stack to clipboard




      My grasp is I need to use a Theme.AppCompat. Which I'm unsure of what that is or how to do this. As I said I am brand new to Android Studio and the interface is very foreign to me.



      One user mentioned




      All you need to do is add android:theme="@style/Theme.AppCompat.Light"
      to your application tag in the AndroidManifest.xml file.




      But I only seem to have a MainActivity.java, content_main.xml and an activity_main.xml,is this a different file I need to add?



      If anyone has any input or help it would be greatly appreciated thank you, I am very new to Android Studio and app development!










      share|improve this question














      I'm using Ubuntu 14.04, I've started to delve into app development and I'm following some online tutorials and I've come across this rendering issue. Whenever I select any theme other than AppTheme.NoActionBar I get an error along the following lines.




      The following classes could not be instantiated: -
      android.support.design.widget.CoordinatorLayout (Open Class, Show
      Exception, Clear Cache) - android.support.design.widget.AppBarLayout
      (Open Class, Show Exception, Clear Cache) Tip: Use View.isInEditMode()
      in your custom views to skip code or show sample data when shown in
      the IDE Exception Details



      java.lang.IllegalArgumentException: You need to use a Theme.AppCompat
      theme (or descendant) with the design library. at
      android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)
      at
      android.support.design.widget.CoordinatorLayout.(CoordinatorLayout.java:178)
      at
      android.support.design.widget.CoordinatorLayout.(CoordinatorLayout.java:172)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:422)

      at
      android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at
      android.view.LayoutInflater.inflate(LayoutInflater.java:394) Copy
      stack to clipboard




      My grasp is I need to use a Theme.AppCompat. Which I'm unsure of what that is or how to do this. As I said I am brand new to Android Studio and the interface is very foreign to me.



      One user mentioned




      All you need to do is add android:theme="@style/Theme.AppCompat.Light"
      to your application tag in the AndroidManifest.xml file.




      But I only seem to have a MainActivity.java, content_main.xml and an activity_main.xml,is this a different file I need to add?



      If anyone has any input or help it would be greatly appreciated thank you, I am very new to Android Studio and app development!







      14.04 java android android-studio






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 4 '15 at 18:11









      AlkarinAlkarin

      831615




      831615






















          1 Answer
          1






          active

          oldest

          votes


















          0














          If you followed the very first "Getting Started" tutorial, you should have a Project tree that looks like the "Modified theme" screen shot I'm including. The AndroidManifest.xml file is under the "manifests" folder, not the "java" or "res" folder.



          Modified theme



          I've already made the change that you mention.



          As a note of commiseration, I'm just now ramping up the same learning curve on Windows and immediately ran into this when trying to render the layout preview for the very first "Hello World" app in the official Google "Getting Started" tutorial. I've got to say, it's pretty discouraging to run into something so cryptic so early on, but according to my friends who know Android, it's a pretty good introduction to the frustrations of developing for the platform. So maybe it's an appropriate introductory experience even if it is sad.






          share|improve this answer
























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f693965%2fandroid-studio-classes-can-not-be-instantiated%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            If you followed the very first "Getting Started" tutorial, you should have a Project tree that looks like the "Modified theme" screen shot I'm including. The AndroidManifest.xml file is under the "manifests" folder, not the "java" or "res" folder.



            Modified theme



            I've already made the change that you mention.



            As a note of commiseration, I'm just now ramping up the same learning curve on Windows and immediately ran into this when trying to render the layout preview for the very first "Hello World" app in the official Google "Getting Started" tutorial. I've got to say, it's pretty discouraging to run into something so cryptic so early on, but according to my friends who know Android, it's a pretty good introduction to the frustrations of developing for the platform. So maybe it's an appropriate introductory experience even if it is sad.






            share|improve this answer




























              0














              If you followed the very first "Getting Started" tutorial, you should have a Project tree that looks like the "Modified theme" screen shot I'm including. The AndroidManifest.xml file is under the "manifests" folder, not the "java" or "res" folder.



              Modified theme



              I've already made the change that you mention.



              As a note of commiseration, I'm just now ramping up the same learning curve on Windows and immediately ran into this when trying to render the layout preview for the very first "Hello World" app in the official Google "Getting Started" tutorial. I've got to say, it's pretty discouraging to run into something so cryptic so early on, but according to my friends who know Android, it's a pretty good introduction to the frustrations of developing for the platform. So maybe it's an appropriate introductory experience even if it is sad.






              share|improve this answer


























                0












                0








                0







                If you followed the very first "Getting Started" tutorial, you should have a Project tree that looks like the "Modified theme" screen shot I'm including. The AndroidManifest.xml file is under the "manifests" folder, not the "java" or "res" folder.



                Modified theme



                I've already made the change that you mention.



                As a note of commiseration, I'm just now ramping up the same learning curve on Windows and immediately ran into this when trying to render the layout preview for the very first "Hello World" app in the official Google "Getting Started" tutorial. I've got to say, it's pretty discouraging to run into something so cryptic so early on, but according to my friends who know Android, it's a pretty good introduction to the frustrations of developing for the platform. So maybe it's an appropriate introductory experience even if it is sad.






                share|improve this answer













                If you followed the very first "Getting Started" tutorial, you should have a Project tree that looks like the "Modified theme" screen shot I'm including. The AndroidManifest.xml file is under the "manifests" folder, not the "java" or "res" folder.



                Modified theme



                I've already made the change that you mention.



                As a note of commiseration, I'm just now ramping up the same learning curve on Windows and immediately ran into this when trying to render the layout preview for the very first "Hello World" app in the official Google "Getting Started" tutorial. I've got to say, it's pretty discouraging to run into something so cryptic so early on, but according to my friends who know Android, it's a pretty good introduction to the frustrations of developing for the platform. So maybe it's an appropriate introductory experience even if it is sad.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 13 '15 at 23:33









                QuantumStateQuantumState

                1




                1






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f693965%2fandroid-studio-classes-can-not-be-instantiated%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                    Mangá

                    Eduardo VII do Reino Unido