Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
1
Question by Hotshot10101 · Jun 20, 2014 at 08:11 PM · androidmanifest

Android Manifest Issue

I am using Unity3D 4.3.4 on a Mac.

I need to make some changes to the default androidmanifest.xml file that Unity produces.

I built my app without doing anything special yet and it runs fine on the Android device.

If I tell the build to generate an android project and then copy the androidmanifest.xml file into Plugins/Android and then build and run I get the following exception in logcat:

E/AndroidRuntime( 8539): FATAL EXCEPTION: main E/AndroidRuntime( 8539): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.powerteq.ultra/com.powerteq.ultra.UnityPlayerNativeActivity}: java.lang.ClassNotFoundException: Didn't find class "com.powerteq.ultra.UnityPlayerNativeActivity" on path: /data/app/com.powerteq.ultra-1.apk E/AndroidRuntime( 8539): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106) E/AndroidRuntime( 8539): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) E/AndroidRuntime( 8539): at android.app.ActivityThread.access$600(ActivityThread.java:141) E/AndroidRuntime( 8539): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)

I have not made ANY changes to the xml file yet. I just copied it and built. Can someone explain and help me fix this?

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 meat5000 ♦ · Jun 20, 2014 at 08:13 PM 0
Share

Tried exporting to eclipse? (google project)

You can access the manifest and anything Android deep from there very easily.

Yes, I see you are on a $$anonymous$$ac. Not sure if there is a $$anonymous$$ac version, sorry.

1 Reply

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

Answer by Hotshot10101 · Sep 13, 2014 at 10:26 PM

Turns out that the manifest that gets created when you export to Android assumes that you will be building inside the Android SDK, so it changes the names and package identifiers to match your own.

If, on the other hand, you are using the manifest file generated when you export as part of a plugin, where you have not subclasses the UnityAndroidPlayer class then Android still wants the default package names and name of the activity.

Therefore you have to change the package name and activity name to what is defined in UnityPlayer's own java classes.

Here is my final androidmanifest.xml:

(notice the use of com.unity3d.player and UnityPlayerActivity)

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:theme="@android:style/Theme.NoTitleBar" android:versionName="1.0" android:versionCode="1" android:installLocation="preferExternal">
   <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
   <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
     <activity android:label="@string/app_name" android:name="com.unity3d.player.UnityPlayerActivity" android:screenOrientation="sensorPortrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
       <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>
   <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="20" />
   <uses-feature android:glEsVersion="0x00020000" />
   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
   <uses-feature android:name="android.hardware.touchscreen" />
   <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
   <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
 </manifest>
 
Comment
Add comment · Show 3 · 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 cTop · Aug 24, 2016 at 05:08 PM 0
Share

Thank you! I'm glad you came back and posted the answer to your own question. You probably saved me hours of digging.

avatar image ismaelnascimento01 · Jan 23, 2019 at 10:12 AM 0
Share

Thank you ! I replace my Android$$anonymous$$anifest for your and work !

avatar image ismaelnascimento01 · Jan 23, 2019 at 10:12 AM 0
Share

Thank you ! I replace my Android$$anonymous$$anifest for your and work !

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.

Follow this Question

Answers Answers and Comments

23 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 avatar image avatar image

Related Questions

Social.localUser.Authenticate((bool success) returns no bool 1 Answer

What's responsible for the `Allow XXX to access your contacts?` when first installing/running a game on Android? 1 Answer

android manifest for unity free 2 Answers

How to handle an intent from another Android App in Unity? 1 Answer

Gradle Build Error: The attribute application@allowBackups=false in :audioinaec: collides with another value 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