Announcement

Collapse
No announcement yet.

Everyplay Plugin.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Everyplay Plugin.

    Hello,

    I am working on few plugins for android, rewarded video ads from, AdColony, AppLovin, Chartboost, UnityAds, Vungle,a simple Sharing plugin so you can share for example to email your score and link of your application and Everyplay. Everyplay is a service which allows you to share gameplay videos from your game. I will release them all to UE4 community for free once they are all tested
    I am using the latest 4.13 preview3 version of the engine.

    I am testing Everyplay plugin right now. The plugin seems to be initialized properly, i am getting an event from the sdk but when i am calling a method, application crashes and i am getting an error:

    E/AndroidRuntime(31909): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/everyplay/Everyplay/R$layout;

    E/AndroidRuntime(31909): at com.everyplay.Everyplay.view.ag.<init>(Unknown Source)

    E/AndroidRuntime(31909): at com.everyplay.Everyplay.view.bi.m(Unknown Source)

    E/AndroidRuntime(31909): at com.everyplay.Everyplay.view.bi.<init>(Unknown Source)

    E/AndroidRuntime(31909): at com.everyplay.Everyplay.view.f.b(Unknown Source)

    E/AndroidRuntime(31909): at com.everyplay.Everyplay.view.EveryplaySocialActivity.onCreate(Unknown Source)

    /......../

    E/AndroidRuntime(31909): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.everyplay.Everyplay.R$layout" on path: DexPathList[[zip file "/data/app/com.YourCompany.RisingBirds-1/base.apk"],nativeLibraryDirectories=[/data/app/com.YourCompany.RisingBirds-1/lib/arm, /vendor/lib, /system/lib]]

    E/AndroidRuntime(31909): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)

    E/AndroidRuntime(31909): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)

    E/AndroidRuntime(31909): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)

    E/AndroidRuntime(31909): ... 18 more

    E/AndroidRuntime(31909): Suppressed: java.lang.ClassNotFoundException: com.everyplay.Everyplay.R$layout

    E/AndroidRuntime(31909): at java.lang.Class.classForName(Native Method)

    E/AndroidRuntime(31909): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)

    E/AndroidRuntime(31909): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)

    E/AndroidRuntime(31909): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)

    E/AndroidRuntime(31909): ... 19 more

    E/AndroidRuntime(31909): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

    V/ApplicationPolicy( 927): isApplicationStateBlocked userId 0 pkgname com.YourCompany.RisingBirds

    W/ActivityManager( 927): Force finishing activity com.YourCompany.RisingBirds/com.everyplay.Everyplay.view.EveryplaySocialActivity

    W/ActivityManager( 927): Force finishing activity com.YourCompany.RisingBirds/com.epicgames.ue4.GameActivity


    I have uploaded the APL file and the full logcat.

    I have started making the plugins prior to 4.13 version.

    I am not sure if i declare correctly the activities, in APL file, for the Androidmanifest, though it seems to write them correctly on APK package or the libraries are linked properly.

    The Everyplay sdk is here: https://github.com/Everyplay/everyplay-android-sdk

    Any ideas what might causing this error?

    I posted a question at answerhub too:https://answers.unrealengine.com/que...ime-error.html

    Best,
    Makis

    * You can download the plugin files(what i have done so far) from the answerhub link above.
    Attached Files
    Last edited by Makis; 09-02-2016, 02:49 PM.
    Pandora Entertainment
    github.com/PandoraEntertainment
    [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

    #2
    There are resource files in the SDK which you also need (the res directory).

    Comment


      #3
      Originally posted by Chris Babcock View Post
      There are resource files in the SDK which you also need (the res directory).
      Hi Chris,

      So i need to add a folder named res in the plugin directory and then copy those resources files from sdk there?

      I will add the resource file from the sdk to the build directory with the following line in the APL:

      <copyFile src="$S(PluginDir)/../../res" dst="$S(BuildDir)/res" />?
      Last edited by Makis; 08-31-2016, 04:06 PM.
      Pandora Entertainment
      github.com/PandoraEntertainment
      [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

      Comment


        #4
        I don't believe that is going to do what you want. You should copy the project directory to JavaLibs in <prebuildCopies> instead. Or, since 4.13 now supports AAR files, you can package it that way and add it as a dependency in the aar-imports.txt (UPL can add to this list; new name for APL).

        Comment


          #5
          Originally posted by Chris Babcock View Post
          I don't believe that is going to do what you want. You should copy the project directory to JavaLibs in <prebuildCopies> instead. Or, since 4.13 now supports AAR files, you can package it that way and add it as a dependency in the aar-imports.txt (UPL can add to this list; new name for APL).
          Hi Chris,

          I packaged the sdk, as an aar file.

          How do we add it, as a depedency, to the aar-imports.txt, with UPL/APL, when using a project plugin?

          Where we could find more info about the new UPL, in 4.13 version?
          Last edited by Makis; 09-01-2016, 03:19 PM.
          Pandora Entertainment
          github.com/PandoraEntertainment
          [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

          Comment


            #6
            You can add a new section to your UPL file:

            Code:
            <AARImports>
            	<insertValue value="repositories $(PluginDir)/../../ThirdParty/repository"/>
            	<insertNewline/>
            	<insert>com.everyplay,Everyplay,1.5.3</insert>
            	<insertNewline/>
            </AARImports>
            Then put your AAR (EveryPlay-1.5.3.aar) in YourPlugin/ThirdParty/respository/com/everyplay/Everyplay/1.5.3 (assuming the build.cs and UPL are in YourPlugin/Source/YourPlugin.

            You will also need a EveryPlay-1.5.3.pom in this directory with your packaging and dependencies.

            Comment


              #7
              I added the new section to UPL and the aar file in Plugins/Everyplay/ThirdParty/respository/com/everyplay/Everyplay/1.5.3.

              I tried to package project and i am getting an error:UnrealBuildTool Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files (x86)\Epic Games\4.13\Engine\ThirdParty\repository'.

              At some point i added the .aar file in a similar folder path in the Engine directory and saw it extracting in to Unreal Projects\RisingBirds\Intermediate\Android\APK,but then i was getting another error about multidex error if i remember correctly.

              Anyway i don't know if it is something wrong in the file structure or because i am missing the .pom file and/or is something wrong with my .aar file.

              How do we create the pom file, from Android studio?


              By the way, here is the plugin file we everything i have done so far, if anyone wants to give it a try with the aar, pom files and wants to use it in his game:
              https://answers.unrealengine.com/que...#answer-481130

              Forums don't let me upload the zip file,so i uploaded at answerhub's question i have posted.
              Attached Files
              Last edited by Makis; 09-02-2016, 02:45 PM.
              Pandora Entertainment
              github.com/PandoraEntertainment
              [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

              Comment


                #8
                I corrected the missing symbol error. Now i am getting the following message:

                AARImports: com.everyplay, Everyplay, 1.5.3

                Unable to find package com.everyplay/Everyplay!

                I added the following pom file:

                Code:
                <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                   <modelVersion>4.0.0</modelVersion>
                   <groupId>com.everyplay.Everyplay</groupId>
                   <artifactId>Everyplay</artifactId>
                   <version>1.5.3</version>
                   <packaging>aar</packaging>
                   <dependencies>
                     <dependency>
                       <groupId>com.everyplay.Everyplay</groupId>
                       <artifactId>Everyplay</artifactId>
                       <version>1.5.3</version>
                       <scope>compile</scope>
                       <type>aar</type>
                     </dependency>
                   </dependencies>
                 </project>
                But i am still getting the same error.
                Pandora Entertainment
                github.com/PandoraEntertainment
                [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

                Comment


                  #9
                  Remove the dependency on itself; this is redundant and incorrect. The groupId would be com.everyplay, not com.everyplay.Everyplay (the artifactId is appended).

                  Comment


                    #10
                    With this pom file:


                    Code:
                    <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                       <modelVersion>4.0.0</modelVersion>
                       <groupId>com.everyplay</groupId>
                       <artifactId>Everyplay</artifactId>
                       <version>1.5.3</version>
                       <packaging>aar</packaging>
                     </project>
                    I am getting the same error.

                    The aar and pom files are in C:\Users\Makis\Documents\Unreal Projects\RisingBirds\Plugins\Everyplay\ThirdParty\repository\com\everyplay\Everyplay\1.5.3
                    Pandora Entertainment
                    github.com/PandoraEntertainment
                    [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

                    Comment


                      #11
                      off topic here, what is the difference between APL and UPL?, the name? I just recompile my plugins for 4.13 and everything work fine, I even don't know before read this today jaja , I figurated new features , where I can see an example of that black magic?

                      Comment


                        #12
                        AndroidPluginLanguage (APL) is now UnrealPluginLanguage (UPL) since iOS now shares it. It is just a name change; you don't have to do anything.

                        Comment


                          #13
                          At UnrealEngine/Engine/Source/Programs/UnrealBuildTool/Android/AndroidAARHandler.cs file i saw the error comes up in this method:

                          Code:
                          public void AddNewAAR(string PackageName, string BaseName, string Version)
                          		{
                          			string BasePath = FindPackageFile(PackageName, BaseName, Version);
                          			if (BasePath == null)
                          			{
                          				Log.TraceError("AAR: Unable to find package {0}!", PackageName + "/" + BaseName);
                          				return;
                                                  }
                          ...
                          I change the pom file:

                          Code:
                          <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                             <modelVersion>4.0.0</modelVersion>
                             <groupId>com.everyplay</groupId>
                             <artifactId>Everyplay</artifactId>
                             <version>1.5.3</version>
                             <packaging>aar</packaging>
                           </project>
                          The aar and pom files are in C:\Users\Makis\Documents\Unreal Projects\RisingBirds\Plugins\Everyplay\ThirdParty\repository\com\everyplay\Everyplay\1.5.3

                          Maybe something is wrong in this path or in the:

                          <insertValue value="repositories $(PluginDir)/../../ThirdParty/repository"/> line?
                          Pandora Entertainment
                          github.com/PandoraEntertainment
                          [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

                          Comment


                            #14
                            <insertValue value="repositories $(PluginDir)/../../ThirdParty/repository"/>

                            should be

                            <insertValue value="repository $S(PluginDir)/../../ThirdParty/repository"/>

                            repositories looks for m2repository directories in the path provided and adds them all, and $S(PluginDir) gets replaced in UPL properly, but $(PluginDir) is passed through and isn't valid since the code that uses it doesn't know which plugin context it came from.

                            Comment


                              #15
                              Yes the repository solved this problem.

                              Now i am getting the following:
                              ====09-Sep-16 8:51:41 PM====UPDATING BUILD CONFIGURATION FILES====================================================
                              Updating project.properties, local.properties, and build.xml for downloader_library...
                              Error: C:\Users\Makis\Documents\Unreal Projects\RisingBirds\Intermediate\Android\APK\JavaLibs\Everyplay-1.5.3 is not a valid project (AndroidManifest.xml not found).
                              Updating project.properties, local.properties, and build.xml for Everyplay-1.5.3...
                              Error: C:\Users\Makis\Documents\Unreal Projects\RisingBirds\Intermediate\Android\APK\JavaLibs\Everyplay-1.5.3 is not a valid project (AndroidManifest.xml not found).
                              Error: No Android Manifest at: C:\Users\Makis\Documents\Unreal Projects\RisingBirds\Intermediate\Android\APK\JavaLibs\Everyplay-1.5.3

                              I notice that at C:\Users\Makis\Documents\Unreal Projects\RisingBirds\Intermediate\Android\APK\JavaLibs\Everyplay-1.5.3
                              there is a folder, Everyplay-1.5.3, containing the R file Android manifest, classes.jar, jni folder etc... All these,files/folders, should be extracted in the
                              C:\Users\Makis\Documents\Unreal Projects\RisingBirds\Intermediate\Android\APK\JavaLibs\Everyplay-1.5.3, right?


                              The package name in Android manifest within Everyplay-1.5.3.aar should be com.everyplay?

                              By the way, if i unziped the aar file, changed a value in manifest then zip it again with .aar extension, would it still work, like the aar file produced from android studio, or it might cause problems to packaging?
                              Attached Files
                              Pandora Entertainment
                              github.com/PandoraEntertainment
                              [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

                              Comment

                              Working...
                              X