Unity says resource style/Theme.AppCompat.Light.NoActionBar not found - android

I have a Unity project which, when compiled via Unity's Gradle build option, fails with
Output: error: resource style/Theme.AppCompat.Light.NoActionBar (aka com.xxx.sdk.unity:style/Theme.AppCompat.Light.NoActionBar) not found.
error: failed linking references.
I can reproduce this same error by entering a terminal, and going into the Temp/gradleOut directory, then saying gradle :MySDK:verifyReleaseResources or gradle :MySDK:assemble. However, if I change it to gradle :assemble then it works fine (this is what Android Studio does when I open the same Temp/gradleOut directory and it builds and runs the app fine):
/opt/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/gradle/bin/gradle :assemble
> Configure project :
> Configure project :MySDK
BUILD SUCCESSFUL in 17s
Is there a way to make Unity3d (2017.2.0f3 in my case as the latest version crashes on Linux) execute the same gradle task as Android Studio? So instead of trying to do :MySDK:whatever it would do :whatever?

Ciao,
try adding .aar files in Assets/Plugins/Android folder.
Something when you build your app for Android, look for that resource (are you using Facebook SDK for example ?) and when building android app Unity need to find that resources in android archives.
This is my configuration :

Related

debug directory does not exist error running React-native's AwsomeProject

I'm trying to create a react-native android app following react-native "Getting started" here but when I try to run it both through CLI and with Android studio it gives me this error:
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: C:\Windows\System32\AwsomeProject\android\app\build\intermediates\res\merged\debug: error: directory does not exist.
I tried deleting the build folder, cleaning the project and re-running it but it doesn't work.
How can I solve this?
If I understand your situation right:
There is absolutely no issue in your Java and XML.
Your project built just fine before this.
You tried to remove the build cache.
In addition to above you should remove the .gradle directory as well.
Unfortunately, some react-native modules have their own build directory inside the node_modules/ directory, so it is possible that you didn't clear the build cache for them.
Of course, it's really hard to go into each module and remove the build cache manually each time, but fortunately, you can change this behavior by adding to build.gradle file something like below:
allprojects {
// ...
buildDir = "${rootProject.rootDir}/.build/${project.name}"
}
Note: This tells gradle to use the same build directory for all projects.
I prefer ".build" as build directory but you may want to change that to "build" in above.

On Unity 2018.1 Android gradle build failing with 'library uses same package'

This issue appears after update to Unity 2018.1. On 2017.3.1 version everything worked fine.
Gradle version: 3.3
Android Plugin version: 2.3.3
Does anyone have an idea how to fix following error?
CommandInvokationFailure: Gradle build failed.
C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -classpath "C:\Program Files\Unity2018\Editor
\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar"
org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ': processReleaseResources'.
> Error: A library uses the same package as this project: com.unity3d.player
The problem was caused by Simple Android Notifications Free asset (https://assetstore.unity.com/packages/tools/integration/simple-android-notifications-free-68626).
AndroidManifest file in simple-android-notifications.aar contains package="com.unity3d.player"
After renaming it to "com.hippogames.simpleandroidnotifications" I now able to build APK.
The strange thing is that the same library was successfully used with Unity 2017.3.1 and plugin worked as expected.
I tried million things, but only this solved my problem:
When adding facebook sdk package to assets, it creates Facebook SDK folder, and plugins are in it. So :
1. I moved everything from inside Facebook SDK folder to Assets folder.
2. Then I go to Assets/PlayServicesResolver/AndroidResolver/Force Resolve (Don't know if this is necessary).
It appears that unity couldn't find the path to plugins for android. I lost 5 days in searching the solution.
follow these steps and rebuild the project
Goto File from unity top Menu
Select Build Settings
From Build Setting click on Player Settings
In Player Setting Inspector Menu Select Other Settings
See for Identification->Package Name
change Package Name to something unique like com.yourname.appname
and save the project and build again

Android project building error - Symbol file with package cannot be empty

I have cloned an android project from gitlab. After building the project it shows the below error with build failed.
java.io.IOException: Internal error: Symbol file with package cannot be empty.
The project is okay on the other android studio from where it pushed to gitlab. what should I do to prevent this error. thanks in advance.
the solution that worked for me was to change the Gradle version from project structure.
in my case, I changed the version to match the local Gradle distribution I downloaded before and then going into Gradle setting in the project settings to check the use local Gradle distribution option of the same version.

TeamCity throws FileNotFoundException trying to load android project

I setup a TeamCity server and have it successfully building several C#.NET projects. Now I'm trying to get it to build a simple Android project but cannot get it to work. Checking the BuildLog it fails with the following error:
[17:00:11][Step 1/1] Using IntelliJ IDEA External Make #141.3028
[17:00:11][Step 1/1] Loading project (2s)
[17:00:13][Step 1/1] C:\TeamCity\buildAgent\system\.jps\c67b7fe19e4788da\-1866084326\gradle\configuration.xml (The system cannot find the path specified)
[17:00:13]
[Step 1/1] java.io.FileNotFoundException: C:\TeamCity\buildAgent\system\.jps\c67b7fe19e4788da\-1866084326\gradle\configuration.xml (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:337)
at org.jetbrains.jps.gradle.model.impl.JpsGradleExtensionServiceImpl.getGradleProjectConfiguration(JpsGradleExtensionServiceImpl.java:125)
at org.jetbrains.jps.gradle.model.impl.JpsGradleExtensionServiceImpl.getGradleProjectConfiguration(JpsGradleExtensionServiceImpl.java:113)
at org.jetbrains.jps.gradle.model.impl.GradleResourcesTarget.computeRootDescriptors(GradleResourcesTarget.java:69)
...
The directory ..\-1866084326\ exists but it does not contain a gradle subdirectory.
I am not very familiar with the details of building gradle/android projects as I've only ever used AndroidStudio's UI to build. I have done a lot of searching but have found virtually no information about setting up an android project in TeamCity beyond what is in the TeamCity user docs that effectively says "use IntelliJ IDEA Build Runner".
I setup a build config with an IntelliJ IDEA Project build step. The project settings are parsed without error and I leave everything the way it was detected. The only parameters I have are Android_SDK = C:\Users\%env.USERNAME%\AppData\Local\Android\sdk, API_Level = 23, and system.path.macro.USER.HOME = %env.HOMEPATH%.
This is on a Windows 7 x64 Pro server.
I can build the project directly in TeamCity's workdir using AndroidStudio so I expect it is a build runner configuration issue, but I cannot find any search results for this specific error. Does anyone have any ideas?

Unable to build titanium android module with ant

I am trying to build module with ant. I am getting below error message.
BUILD FAILED
/Users/XXXX/Library/Application Support/Titanium/mobilesdk/osx/3.4.1.GA/module/android/build.xml:163: /Users/XXXX/Documents/titanium-test-workspace/holograph/lib does not exist.
Path to module repo : TiHoloGraph
Settings in my build.properties are
titanium.platform=/Users/XXXX/Library/Application Support/Titanium/mobilesdk/osx/3.4.1.GA/android
android.platform=/Users/XXXX/Documents/android-sdk-macosx/platforms/android-19
google.apis=/Users/XXXX/Documents/android-sdk-macosx/add-ons/addon-google_apis-google-19
android.ndk=/Users/XXXX/Documents/android-ndk-r1
any help?
I've had the same problems with building modules.
Somehow ANT cannot create a lib folder in MacOS.
Just create a /Users/XXXX/Documents/titanium-test-workspace/holograph/lib folder yourself and you'll be fine

Categories

Resources