• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Fadi · Jan 27, 2015 at 06:59 AM · androidbuildsdk

android build problem (SDK)

Hi...

I had used Unity Pro 4.6 and it works well. But after I installed Unity Patch 4.6.1p4 every time I build my app I've got this error :

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details. E:\Program Files\android-sdk\build-tools\21.1.2\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "E:/Program Files/android-sdk/platforms/android-21\android.jar" -F bin/resources.ap_

AndroidManifest

 <?xml version="1.0" encoding="utf-8"?>
 <manifest
     xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.unity3d.player"
     android:installLocation="preferExternal"
     android:theme="@android:style/Theme.NoTitleBar"
     android:versionCode="1"
     android:versionName="1.0">
     <supports-screens
         android:smallScreens="true"
         android:normalScreens="true"
         android:largeScreens="true"
         android:xlargeScreens="true"
         android:anyDensity="true"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE "/>
     <application
         android:icon="@drawable/app_icon"
         android:label="@string/app_name"
         android:debuggable="true">
         <activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
                   android:label="@string/app_name">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
             <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
             <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
         </activity>
     </application>
 </manifest>



Using :

Unity Patch 4.6.1p4

Java : jre1.8.0_31

ADDED JAVA_HOME in Environment Variables

Android SDK Tools 24.0.2

SDK Platform Tools 21

SDK Build Tools 21..2

How can I fix this error ...

thank you ...

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Nomibuilder · Jan 27, 2015 at 02:51 PM 0
Share

If you have everything ok. Then build any other project. it will solve the project. It solved $$anonymous$$e some days ago. Couldn't find out what was the problem.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Yury-Habets · Jan 27, 2015 at 08:10 AM

First of all, you need JDK, not JRE: http://unity3d.com/unity/system-requirements

Second, the real aapt error output is lower in the console, under stdout tag. If you don't find it - please take a look at the log files http://docs.unity3d.com/Manual/LogFiles.html for the complete error description. This may be something related to manifest and missing resources.

Comment
Add comment · Show 9 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fadi · Jan 27, 2015 at 01:19 PM 0
Share

thank you for the replay

Console Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details. E:\Program Files\android-sdk\build-tools\21.1.2\aapt.exe package --auto-add-overlay -v -f -m -J gen -$$anonymous$$ Android$$anonymous$$anifest.xml -S "res" -I "E:/Program Files/android-sdk/platforms/android-21\android.jar" -F bin/resources.ap_

 stderr[
 Android$$anonymous$$anifest.xml:6: Tag <uses-permission> attribute name has invalid character ' '.
 ]
 stdout[
 Configurations:
  (default)
  ldpi-v4
  hdpi-v4
  xhdpi-v4
  xxhdpi-v4
  xxxhdpi-v4
 
 
avatar image Fadi · Jan 27, 2015 at 01:21 PM 0
Share

LOG :

AndroidSD$$anonymous$$Tools:

 root          : E:/Program Files/android-sdk

 tools         : E:/Program Files/android-sdk\tools

 platform-tools: E:/Program Files/android-sdk\platform-tools

 build-tools   : E:\Program Files\android-sdk\build-tools\21.1.2



 adb      : E:/Program Files/android-sdk\platform-tools\adb.exe

 aapt     : E:\Program Files\android-sdk\build-tools\21.1.2\aapt.exe

 zipalign : E:\Program Files\android-sdk\build-tools\21.1.2\zipalign.exe

 java     : java.exe



Error building Player: Win32Exception: ApplicationName='javac.exe', CommandLine='-bootclasspath "E:/Program Files/android-sdk/platforms/android-21\android.jar" -d "E:\Unity 3D\Projects\In Progress\Unity Assets\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\Company\TestProject\R.java" "com\unity3d\ads\android\R.java"', CurrentDirectory='E:\Unity 3D\Projects\In Progress\Unity Assets\Temp\StagingArea\gen'

avatar image meat5000 ♦ · Jan 27, 2015 at 01:22 PM 1
Share

This one seems quite straight forward

Android$$anonymous$$anifest.xml:6: Tag attribute name has invalid character ' '

Check line 6 of Android$$anonymous$$anifest and delete the erroneous white-space.

avatar image Yury-Habets ♦♦ · Jan 27, 2015 at 01:28 PM 1
Share

Right, the manifest has wrong space here:

uses-permission android:name="android.permission.READ_PHONE_STATE "

$$anonymous$$issing javac is because you are missing JD$$anonymous$$.

avatar image meat5000 ♦ · Jan 27, 2015 at 01:31 PM 0
Share

To be clear, you mean the space between STATE and " ?

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What does this error even mean? 1 Answer

How do I choose the Android SDK version for Unity Cloud Build? 0 Answers

I have a problem with my sdk version. Please help me 0 Answers

Can't build for Android 0 Answers

Java error when building 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges