Reputation: 2227
In order to troubleshoot a bigger problem I created a sample app on which I can test where the problem(s) is. The code is basically the same as the one generated by the single view wizard.
When I launch it on desktop via appliaction > run
it works fine. When I run it from my device via other > androidInstall
I get a black screen (I also ran clean
beforehand). So I launched adb logcat
and found this error:
E DalvikLauncher: java.lang.ClassNotFoundException: Didn't find class "com.gluonapplication.GluonApplication" on path: DexPathList[[zip file "/data/app/com.gluonapplication-1/base.apk"],nativeLibraryDirectories=[/data/app/com.gluonapplication-1/lib/arm, /data/app/com.gluonapplication-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
which is no surprise because there is no class there. The main class is at main.GluonApplication
(bad package name maybe but it's the test app). The build.gradle
specifically specifies mainClassName = 'main.GluonApplication'
. So why is the Android version looking somewhere else? Is there a manifest I need to edit/recreate? Is there some sort of caching done somewhere where previous versions of the app might reside and affect current version?
Upvotes: 0
Views: 117
Reputation: 45476
Whenever you use the IDE plugin to create a project, there is a default manifest AndroidManifest.xml
, added to the src/android/
folder.
If you open it, you will find the package name assigned, that will match the package of the main class, and its full name.
According to what you find on your log, this will be your current manifest:
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gluonapplication"
android:versionCode="1"
android:versionName="1.0">
<supports-screens android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="21"/>
<application android:label="GluonApplication" android:name="android.support.multidex.MultiDexApplication" android:icon="@mipmap/ic_launcher">
<activity android:name="javafxports.android.FXActivity" android:label="GoNative" android:configChanges="orientation|screenSize">
<meta-data android:name="main.class" android:value="com.gluonapplication.GluonApplication"/>
<meta-data android:name="debug.port" android:value="0"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Just make sure that the package name matches the real one, or else make the necessary changes.
Also notice that on Android you need at least two words and a dot for a valid package name, like com.gluonapplication
.
Upvotes: 1