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
Changing to
classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
fixed issue
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.
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)...
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 ) .
Change classpath 'com.android.tools.build:gradle:2.1.2'
to classpath 'com.android.tools.build:gradle:2.1.0'
fixes my problem.
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 :/