Hi there,
I’ve built and published an Alpha into the Android store. The Debug versions and Release versions work just fine when publishing directly from unity but I’ve uploaded the .pak and .obb files to Google Play, tried downloading it and got this:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{xx.xxxxxxxxxx.xxxxxxxxx/xx.xxxxxxxxxx.xxxxxxxxx.QCARJavaActivity}: java.lang.ClassNotFoundException: xx.xxxxxxxxxx.xxxxxxxxx.QCARJavaActivity
I’m really stumped. Everything I’ve read indicates a possible Android Manifest file issue, like forgetting to add the main activity or using an improper path.
Here’s the Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xx.xxxxxxxxxx.xxxxxxxxx"
android:versionName="1.0"
android:versionCode="1"
android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="17" />
<permission android:name="xx.xxxxxxxxxx.xxxxxxxxx.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="xx.xxxxxxxxxx.xxxxxxxxx.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.camera" />
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:label="@string/app_name" android:allowBackup="true" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:debuggable="false">
<uses-library android:name="com.google.android.maps" android:required="false" />
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="XXXXXXXXXXXXXXXXXXXXXXXXX" />
<activity android:name=".QCARJavaActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerNativeActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
</activity>
<activity android:name="com.unity3d.player.VideoPlayer" android:label="@string/app_name" android:screenOrientation="portrait" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
</application>
</manifest>
Everything looks to be correct (XXX’s are added just now).
When declaring my activity:
public class QCARJavaActivity extends QCARPlayerActivity implements LocationListener {
It’s public, it matches the name in the manifest, it’s On Create Method is set up properly:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
I’m just not sure where else to look. I’d setup my eclipse environment properly for sdk 16 (4.1.2). I’ve checked that In Java Build Path>Order and Export, that the QCAR, QCARUnityPlayer, and Classes JARS are all added and checked. Google PlayServices Lib has been added to the Library in Properties/Android. The Android Library part of the Eclipse/adt project isLibrary (true) in Properties/Android. The Stack trace doesn’t reference an external SD card path (so it’s unclear if that could still be an issue).
The Jar builds without any issues, It’s added to the Unity Assets/Plugins/Android folder, it’s referencing all of the Drawables properly, building from Unity to a device directly always works, my maps appear QCAR works (most of the time, there still seems to be a Camera Services Connection refused bug which is driving me crazy).
What else could I possibly be missing??? ![]()
One possibility I just noticed is that I did refactor my package name from a debug package name to the one I need for the release, but I can’t seem to get a project to compile when I create one from scratch. The original directions I used to set up this project have been removed from youtube, so starting is sort of a last resort at this point.![]()