Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication ?Android

后端 未结 16 2435
忘了有多久
忘了有多久 2020-11-28 02:43

I updated my Android Studio to version 2.0. But I had a problem, I don\'t know why?

The important error info:

Unable to instantiate applicati

相关标签:
16条回答
  • 2020-11-28 03:33

    Changing to

    classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
    

    fixed issue

    0 讨论(0)
  • 2020-11-28 03:35

    Just for those who want to update classPath with latest gradle plugin version, Where to find latest plugin version?

    Check in http://tools.android.com/tech-docs/new-build-system and update your classPath. Latest one at current is

     classpath 'com.android.tools.build:gradle:2.0.0'.
    

    Always try to build with latest plugin version.

    0 讨论(0)
  • 2020-11-28 03:36

    I was able to get rid of this error by updating gradle-wrapper.properties to gradle-2.14.1-all, and cleaning/rebuilding the project. Then it ran fine. No other changes were needed (as those suggested in the above answer)...

    0 讨论(0)
  • 2020-11-28 03:40

    I also faced the same problem and i solved it. In my case it was due to a mistake in global class ( Throughout Application context class ) , my mistake was in AndroidManifest.xml i have declared the Application class VolleyHelper as :-

     <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:supportsRtl="true" android:name=".VolleyHelper"
            android:theme="@style/AppTheme"> 
    

    but in VolleyHelper.java i don't have a Default constructor . So i added default constructor in VolleyHelper.java ( Application Class ) .

    0 讨论(0)
  • 2020-11-28 03:41

    Change classpath 'com.android.tools.build:gradle:2.1.2' to classpath 'com.android.tools.build:gradle:2.1.0' fixes my problem.

    0 讨论(0)
  • 2020-11-28 03:41

    No need to disable "instant run".
    1. go to project's root using File Explorer
    2. Finish Android Studio(AS)
    3. delete(relocate somewhere) ".gradle" 's folder content
    (to clean some cashs and old artifacts)
    4. in res folder clean off all inappropriate files
    5. launch the AS again
    6. in module's build.gradle set "buildTypes { debug {minifyEnabled true" to false
    (that looks like an error was in my proguard file, kek)

    Sync, compile and run the app again :/

    | improve this answer | |
    0 讨论(0)
提交回复
热议问题