Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Launch #10

Open
BenVanCitters opened this issue Jan 24, 2018 · 2 comments
Open

Crash on Launch #10

BenVanCitters opened this issue Jan 24, 2018 · 2 comments

Comments

@BenVanCitters
Copy link

BenVanCitters commented Jan 24, 2018

I am having an extremely difficult time getting this plugin to work for Android.

'Fresh Download' Steps :

  1. Download zip of latest code from https://github.com/localytics/localytics-unity and extract
  2. Create a new, empty Unity (2017.2) project
  3. Add the pre-created 'localytics-unity-android-4.2.1.unitypackage' from this 'release' folder in this repo to the project
  4. Set the Project 'Package Name' to be 'com.Company.LocalTest'
  5. Edit the android manifest to use my Localytics key
  6. Add basic script to
  7. Inside Unity choose File->Build Settings...
  8. Choose Android Platform and leave 'build system' on Internal (Default)
  9. Select 'Build And Run'
  10. Project is built... App is sent to device

Results:

  • Application launches and instantly crashes

Seen in log:

  • AndroidRuntime: Caused by: java.lang.NoSuchMethodError: No direct method <init>(Landroid/content/ContextWrapper;)V in class Lcom/unity3d/player/UnityPlayer; or its super classes (declaration of 'com.unity3d.player.UnityPlayer' appears in /data/app/com.Company.LocalTest/base.apk)

'Build Fresh' Steps

  1. Download zip of latest code from https://github.com/localytics/localytics-unity and extract
  2. Per instructions in the Github, navigate terminal to extracted folder and execute 'generate_packages.sh'
  3. Note that java build step fails due to 'ant' not being installed by default on system
  4. Also note that most of script may continue to execute without any indication of failure while the fatal error is hidden at the top of the log.
  5. Further note that unity packages thus created do not contain either a complete or operational plugin
  6. Install 'ant' following advice sought via search engine
  7. Navigate terminal to extracted folder and execute 'generate_packages.sh'
  8. Note the java build step still fails with output:
    BUILD FAILED /Users/USERNAME/Documents/localytics-unity-master/localytics-android/build.xml:90: Cannot find /Users/USERNAME/Library/Android/sdk/tools/ant/build.xml imported from /Users/USERNAME/Documents/localytics-unity-master/localytics-android/build.xml
  9. Note that, even if the unity package build commands independently execute without error, the .unitypackage files generated will now not contain either the 'LocalyticsApplication' or 'LocalyticsUnityPlayerActivity' classes needed for correct operation with the supplied AndroidManifest.xml.

Results:

  • Apps created and installed using packages built with this procedure will crash on launch as well, but the errors visible on the Android device will be something about the missing classes 'LocalyticsApplication' or 'LocalyticsUnityPlayerActivity' referenced from the AndroidManifest.xml
@Mriegel
Copy link
Contributor

Mriegel commented Feb 23, 2018

@BenVanCitters First off sorry for the delayed response here. Do you mind opening a support ticket with our support team ([email protected]) if this issue persists?

@BenVanCitters
Copy link
Author

Hi @Mriegel ,
I fixed the problems I was experiencing in pull request #11"Unity 2017.3 + Android Studio". This pull request was a long time in the making and addresses pipeline issues that are present in the current repository as well as eliminating the problems in the built artifacts. Please review and merge this pull request to ensure current and future stability of your Unity plugin.

I did reach out to the support team. Ultimately, after several weeks of exchange, they were unable to to provide assistance to my team or our client in fixing our crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants