I've been using cordova through Windows CLI for years without an issue. Since updating to cordova 8.0.0 no Android build will run on a device or emulator.
As far as I can tell I've now uninstalled and reinstalled everything. And now only testing with the helloworld default project and still getting the same issue. On launch it just displays that HelloWorld has stopped.
Every apk results in :
AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.hello/com.example.hello.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.hello.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.hello-ZStkpWQT_YEARbjw--2a6Q==/base.apk"]
Tried every related suggestion on here and still no joy.
Currently: Cordova 8.0.0 Java JDK: 1.8.0.91 Gradle: 4.4 npm: 6.1.0 Android: 7.0.0 Android target: 26
hello\platforms\android\app\src\main\AndroidManifest.xml created by cordova
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="com.example.hello" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" />
</manifest>
Any suggestions would be greatly appreciated.
Thanks in advance.
[SOLVED] With all the updates it seems the environment variables had got out of sync and there must have been some left overs from uninstalls that meant it looked like it was building correctly. Updated these and everything is working fine now.
Path:
Also see https://www.fiznool.com/blog/2017/05/30/a-guide-to-installing-cordova-on-windows-10/ which prompted me to investigate every element of the installs.