Announcement

Collapse
No announcement yet.

.AAR libraries are not being imported at all in 4.13

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

    #16
    Originally posted by brunogbrito View Post
    @Auron#5260 I had a different problem days ago, by chance I saw your topic and realized that this line was happening in my build oftenly before PERFORMING FINAL APK PACKAGE OPERATION

    Code:
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.AddRepositories: Added repository: C:\Program Files (x86)\Epic Games\4.13\Engine\Source\ThirdParty\Android\extras\android\m2repository
    UATHelper: Packaging (Android (ETC2)): UEDeployAndroid.ExtractAARAndJARFiles: AARImports: com.google.android.gms, play-services-ads, 9.2.0
    UATHelper: Packaging (Android (ETC2)): UEDeployAndroid.ExtractAARAndJARFiles: AARImports: com.google.android.gms, play-services-auth, 9.2.0
    UATHelper: Packaging (Android (ETC2)): UEDeployAndroid.ExtractAARAndJARFiles: AARImports: com.google.android.gms, play-services-games, 9.2.0
    UATHelper: Packaging (Android (ETC2)): UEDeployAndroid.ExtractAARAndJARFiles: AARImports: com.google.android.gms, play-services-nearby, 9.2.0
    UATHelper: Packaging (Android (ETC2)): UEDeployAndroid.ExtractAARAndJARFiles: AARImports: com.google.android.gms, play-services-plus, 9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-ads-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-ads-lite-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-basement-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR support-v4-23.0.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-base-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-tasks-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-clearcut-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-gass-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-auth-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-auth-base-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-games-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-drive-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-nearby-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.ExtractAARs: Extracting AAR play-services-plus-9.2.0
    UATHelper: Packaging (Android (ETC2)): AndroidAARHandler.CopyJARs: Copying JAR support-annotations-23.0.0.jar
    Now that I solved it don't appears anymore. I'm not an expert but I know what it feels getting days to solve a problem and maybe tis can help you, idk, just a hint.
    Did you update CodeWorks? if u did, uninstall it and install 1R4u2.

    Are you using source? if you are my suggestion would be
    -delete the folders: Binaries, Build, Intermediate, DerivedDataCache
    -generate the project file and build your project again

    that fixed my problem. My problem was different than yours. it was that some libraries was missing in the APK Final Operation step, I thought it was ANT problem, or code works, but after I deleted those folders and build it again, it worked and those extracting lines are not appearing anymore.

    good luck
    Spoke with you on the Discord mobile channel about that. It's not a CodeWorks / Android SDK issue and I've been regenerating my project every now and then already. Tried packaging the APK with 4.14 Github Source, didn't help at all. In my AAR's .pom file I list the appcompat v7 as a dependency and it gets exploded into the \Intermediate\ folder during the packaging process, but it seems its resources are being ignored from UBT and/or ANT.

    Comment


      #17
      Originally posted by _Auron_ View Post
      Just sent you a private message about that. Sorry for the delay, just came back from Thanksgiving break and moving homes.
      Check your private messages.
      Last edited by Makis; 11-28-2016, 05:18 PM.
      Pandora Entertainment
      github.com/PandoraEntertainment
      [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

      Comment


        #18
        Thanks to email communication with Makis and doing some thorough back and forth work with my plugin, I've managed to get our .AAR SDK imported and through JNI calls initialized on top of the UE4 GameActivity during runtime on-device. Thank you again Makis, and thanks Chris Babcock for support on this matter.

        I will try to find time to write up a detailed article for other developers on how to import and use a .AAR compiled library in a UE4.13+ project until UE4 has gradle and merge support.


        What I had to do in this particular case following the last forum posts:

        Example: error: Error: No resource found that matches the given name (at 'textAppearance' with value '@style/Base.TextAppearance.AppCompat.Subhead').Solution: I had to find the Base.TextAppearance.AppCompat.SubHead value from it appcompat v7's values.xml and copy it into my .AAR's /res/values.xml as well as any parent or dimension values it depended on, plus all other styles and their recursive values. Once I did that, went through the proper JNI calls, and added my SDK's AndroidManifest.xml activities into the plugin's UPL definition, all went smoothly.


        **** PROTIP: If you need to get the UE4 GameActivity context in JNI to initiate an overlay on top of your game (or whatever else you'd need the game activity context for), you'd do so like this:

        // Initialize JNI
        JNIEnv* env = FAndroidApplication::GetJavaEnv();


        // Grab UE4 game activity class name and SDK class name
        jclass jcUE4ActivityClass = FAndroidApplication::FindJavaClass("com.epicgames.ue4.GameActivity");
        jclass jcPluginJavaClass = FAndroidApplication::FindJavaClass("com.mycompany.myplugin.myclass"); // Rename to whatever your SDK package name is


        // Get instance of SDK class
        // * Note: this part may not be required if you only need to make a static method call to store the Context/Activity reference
        jmethodID constructor = env->GetMethodID(jcPluginJavaClass, "<init>", "()V");
        jobject joSDK = env->NewObject(jcPluginJavaClass, constructor);


        // Get instance of UE4 game activity
        jmethodID getActivity = env->GetStaticMethodID(jcUE4ActivityClass, "Get", "()Lcom/epicgames/ue4/GameActivity;");
        jobject joUEActivity = env->CallStaticObjectMethod(jcUE4ActivityClass, getActivity);


        // Store Context reference within SDK
        // * Note: these two JNI calls may slightly differ depending on your use case (static call vs. class object, Context vs. Activity, non-Void method return, etc.) - see above note.
        jmethodID jmSetContext = env->GetMethodID(jcPluginJavaClass, "setContext", "(Landroid/content/ContextV");
        env->CallVoidMethod(joSDK, jmSetContext, joUEActivity); // UE4 GameActivity context reference is now stored in SDK

        Cheers and look forward to .AAR and Gradle build support being fully integrated in the near future releases!
        Last edited by _Auron_; 12-06-2016, 01:23 PM.

        Comment

        Working...
        X