Unity Android adding com.facebook.FacebookContentProvider to manifest when it shouldn't - android

I'm developing a test app with some pretty basic functionality to prove a few concepts. I do not have any Facebook plugins or SDKs included, nor do I want them. I just want to test some Google Play services on an actual Android device. However, when I build the apk, and run it from Android Studio, the AndroidManifest has a series of activity tags with references to com.facebook, and a provider named com.facebook.FacebookContentProvider.
If I deploy the apk to my device, I get this error:
java.lang.RuntimeException: Unable to get provider
com.facebook.FacebookContentProvider:
java.lang.ClassNotFoundException: Didn't find class
"com.facebook.FacebookContentProvider" on path: DexPathList[[zip file
"/data/app/com.DanGame.TestApp-KgL6Jybi9sG1Q0LHnxAnNA==/base.apk"],nativeLibraryDirectories=[/data/app/com.DanGame.TestApp-KgL6Jybi9sG1Q0LHnxAnNA==/lib/arm,
/data/app/com.DanGame.TestApp-KgL6Jybi9sG1Q0LHnxAnNA==/base.apk!/lib/armeabi-v7a,
/system/lib]]
I could just bite the bullet and include the Facebook SDK, or try to manually adjust the manifest after it's generated. But what I really need to know is how to get Unity to stop generating a bad manifest? There has to be a way to build a functioning Android apk from Unity without Facebook.

Looks like the issue was a caching problem. I was building the APK in Unity and profiling it from Android Studio. But Android Studio caches off the APK in the Users directory, so recompiling the apk in Unity will not reload the Android Studio project. Even though I had cleared all references to Facebook from my manifest in Unity, Android Studio was using an old apk.

Related

ClassNotFoundException only when downloading from Google Play, using Android Studio 4.1.2 and Android Application Bundle

I have written an app, and have uploaded it to internal testing on Google Play.
Following Google's recommendation, this time I have gone with an Android Application Bundle instead of an APK.
When I download it from the Play store, it crashes immediately with java.lang.ClassNotFoundException
If I run the app through Android Studio as a Default APK, it works fine.
If I run the app through Android Studio as "APK from app bundle", it also works fine.
My app has three modules. "app" is the main bit. I have a 3d engine module named bulletspeed. The missing class is from the bulletspeed module. I don't know if the third module is missing classes yet, as the program hasn't advanced that far before crashing.
Is there some sort of module setting that I am missing?
Thanks for any help!
As it turns out, my issue was was with proguard. The classes were there all along, just renamed to c.c.b.a.wtf.etc
During the build process, I serialize some 3D scenes into a Java ObjectOutputStream.
In my program, I deserialize the scenes from OOS resources back into Objects
Deserialization could not find the classes by name as the names were obfuscated
Following this guide, I was able to configure proguard rules so that I could deserialize normally: https://medium.com/androiddevelopers/practical-proguard-rules-examples-5640a3907dc9
It doesn't solve the issue but helps you with testing:
Download the bundletool from Google https://developer.android.com/studio/command-line/bundletool and create apk from app bundle locally to test, so you won't need to create a bunch of internal app testings and wait...
create the app bundle (.aab) and locate the folder
java -jar "bundletool-all-x.x.x.jar" build-apks --bundle="yourpathto.aab" --output="folderoutput.zip" --mode="universal"
unzip the created zip package
install the general apk into your test device/emulator
You can try uncompressing native libs by default in your Android Manifest.
Setting android:extractNativeLibs=false to reduce app size

How do I open an Android app's .APK file to update underlying code?

My app is developed in react-native and the third party app provider are charging to implement the code for deep-linking.Though they have shared the .APK file with me.Through some videos & google search,I have learned that I will be able to do it by myself.I want to add deep-linking code in the AndroidManifest.xml file but how to open .apk in Android Studio and how to generate .apk file again once the changes are complete after testing on virtual device.
If you think that there will be issues by approaching through .APK file or its not the best way/standard process to achieve this ,then,please suggest me that what I need to ask them to share with me so that it can be imported in Android Studio without any issues and I can do some coding & test it and again generate .apk file to upload it on Google Play Store.
I'm pretty sure you will not be able to do that, you will have to access the source code to do the changes.

Your Instant App APKs do not declare a valid

Am having a bad time with android in order to create new release
i have created a Signed APK with two option
then i zipped the .apk file,after trying to upload it to google console am getting the below error
Your Instant App APKs do not declare a valid 'android:targetSandboxVersion' attribute in their AndroidManifest. Using the 'com.android.feature' Gradle plugin to build your Instant App would add this attribute automatically.
Note : the file zipped and all the solutions asking to zip the file, no luck :(
You need to be clear if you are producing an Instant App or a normal Android app. I think this is what is confusing you, or maybe you just aren't being clear in the question.
Android Instant Apps are special Android apps that launch from a web page, and don't need a user to install them. To build them you need the Instant Apps SDK, and to follow the development instructions here. Android Studio will produce a zip for you, you don't need to do it manually
For normal Android apps, you don't need to zip your APKs. Just upload the APK itself to the Play Console.
I think you are probably making a normal Android app, but because you are zipping it, the Play console thinks you are uploading an instant app. So stopping Zipping your APK, and just upload it to the Play Console as a ".apk" file.
While you are at it, I'd recommend using APK V2 signing - it gives much faster installation on modern devices.

Unable to find generated app .apk in Android Studio project

I am developing an android app project and I am able to directly load it on my android phone. But I am unable to find the .apk file corresponding to the app. I have already checked out a few stackoverflow pages for how to resolve this, but I am unable to do so.
I do not have a bin folder at all anywhere within my project. The only .apks I am able to find within the folders are the app-debug.apk and related ones.
How do I force generate the apk when I run the project within Android Studio? Such problems do not exist in Eclipse.
Android Studio puts resulting apks in the <your-project-name>/<your-app-name>/build/outputs/apk/ directory. Look here.
If you want to debug the application you can use the app-debug. Otherwise go up to build and press generate signed apk and choose release (if you want it as the final app) or debug for debugging.

Android and Unity 3D game development

I am starting to explore the game development using unity 3d for android. I have downloaded the trial version of unity 3.3. I went through few tutorials.
I have one question that is not answered. In the normal apps which we develop using eclipse, we can deploy onto mobile by copying the apk file. What about unity 3d? How do I get the game onto my phone. I don't want to publish on market.
It is possible to transfer your assets to Eclipse. When it's integrated you can debug via your android phone. Be sure to read the tutorial on Unity's homepage. There is a step by step start-up guide and some more. Following links are worth looking at:
Getting started with Unity and Android
Official - Integrating Unity with Eclipse
Alternative link - Integrating Unity with Eclipse
It would seem that the official "integration" link is broken so I updated with a forum post that covers the same topic. However I recommend to try with the official link first.
Yes, you can simply copy the apk to your device and install it. Unity builds an apk file (and will optionally sign it using a keystore that you provide or let it generate for you). Once it has built that apk you can deploy it normally. You can even have it include a customized manifest in the apk that it builds if you want to (but it generates a nice one from your settings in the unity project by default).
There are two methods for this, as far i understand,
Using Build Settings--> Build, It builds the apk file that can be installed on your device using adb install <apk file path and name>
Using Build Settigs--> Build and Run. Which automatically installs the apk built apk file on your device if connected
go to file
-build
-select android platform(your pc has to have android development kit)
-save your apk
As it is still unanswered I try to close this question
First of all, current version of Unity 5.2 is much more powerfull than version 3.3. mentioned in original question.
What about unity 3d? How do I get the game onto my phone. I don't want to publish on market.
The same way. Unity allows you to publish build as *.apk on ocal machine and then you can just copy it to your phone and install it.
What is more cool, now you can debug your application running on phone. You have to install Unity Remote to the phone and run. Now you can set breakpoints and debug as normally.
If you change your mind and go to publish on Market - Unity will sign your *.apk
Hope this helps someone, good luck!
The Same way you generate the apk through Eclipse like that in unity you need to build the project. For that android sdk and jdk should be installed in your system and u need to show those path in the unity Preferences then u need a google keystore and need to sign in with that key store in the Publisher settings and then u are able to build the apk which will be store in your local system and you can copy that to your mobile and install the apk file.

Categories

Resources