For a couple days I tied to implement the splash screen on Android Xamarin Forms Application, I tied many approaches but all failed in the same way,
The application before adding the splash screen is working fine,
After adding the splash screen i get this error message
3>------ Deploy started: Project: NoorAlEman.Android, Configuration: Debug Any CPU ------
3>Error: Cancelled
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
sometime the application run without showing the splash screen for one time only if i delete "bin" and "obj" folder and rebuild the solution and most of other time it keeps showing the same error message.
I am sure about adding all files using visual studio 2019 interface, also all files have
Build Action: AndroidResource
Copy to output directory: Do not copy "Also i tried to make it as copy always"
Custom tools: I tried to leave it empty and other times i set to "MSBuild:UpdateGeneratedFiles"
Other thing i done is to set the MainLauncher to false in the manactivity.cs and setting it to true in the splashsctivity.cs
I tried these tutorials and all ended up showing the same error
(1) https://learn.microsoft.com/en-us/xamarin/android/user-interface/splash-screen
(2) https://progrunning.net/best-way-to-create-a-splash-screen-in-xamarin-forms-android-project/
(3) http://ebubekirsezer.com/en/xamarin-forms-splash-screen/?unapproved=11607&moderation-hash=67d1307ecdd13ca8e5b0acceae43d22d#comment-11607
Please do you have any suggestion that might resolve this issue.
Thank you in advance
M. Mazin
What I did was to create a new activity, say SplashActivity with the following attributes [Activity(MainLauncher = true, Theme = "#style/MainTheme.Splash", NoHistory = true)], where the Theme would be an image, or whatever you want your splashscreen to be. Then inside you just start the main activity of your application, something like this:
protected override void OnResume()
{
base.OnResume();
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
}
Don't forget to remove the MainLauncher attribute from the MainActivity.
Hope it helps!
For me the only solution was:
-rebuilding the project
-closing and reopening VS
-disconnecting and reconnecting my mobile device
I don't know where this error comes from, and it's a real pain, but this way you can at least keep testing your app until there comes an update which fixes it.
Related
I am getting this after my react native build is successful :
transform[stderr]: [BABEL] Note: The code generator has deoptimised
the styling of /Users/myName/Desktop/mool_mobile/unknown as it exceeds
the max of 500KB.
In the emulator the splash screen shows up for 1 minute or so and then it eventually crashes. Couldn't find much resources regarding this issue.
Thanks in advance.
As it says in this Response:
It's just a warning (not an error) that can be safely ignored.
However, if you want to silence it, you might try to set the https://babeljs.io/docs/en/options#compact option to true
Response link: https://github.com/babel/babel/discussions/13676#discussioncomment-1183149
I'm trying to add a custom action to the media session's playback state, so it can show an addition button on Android Auto. The code is indeed simple, the button is added and I can receive its callback, but the problem is the button doesn't have an icon:
The code:
val builder = PlaybackStateCompat.Builder()
builder.addCustomAction(
"ACTION_TEST",
"TEST LABEL",
R.drawable.ic_test // I tried vector drawable, png,... nothing works
)
// ...
mediaSession.setPlaybackState(builder.build())
The result: the added button doesn't have an icon, only shows a ripple effect (the circle in the screenshot) when I click it, otherwise it's invisible.
I found out the root cause. It's because Android Studio auto-optimizes the build process to produce minimal APK that can run on current ADB-connected devices.
In my case, AS included only xhdpi resources in the debug APK, therefore Android Audio HeadUnit couldn't load the drawable. Basically, AS silently changed the Gradle config to somewhat like this:
android {
...
productFlavors {
dev {
resConfigs "xhdpi" // <- root cause
}
...
}
}
I can simply run my app from the terminal to get rid of this problem.
If you have the same problem, just ensure the drawable is available for all screen densities (hdpi, xhdpi,...), and check your APK whether it's packaged with resources in all screen densities.
For me, the problem was resolved when I cleared the data of Android App application on my phone.
Was using it to run DHU emulator on desktop. Somehow its caching went awry.
I am using the Ionic Framework to build a mobile app for Android/iOS. I was able
to build the project for android (ionic build android). When I run the app, it will be only a white screen, that's because there is an error (when you use GapDebug, you can run apps on your phone and you will be able to debug, and see errors). Now if I run it on the desktop browser there really is NO error and everything is working. Below is the error that is shown in GapDebug:
Now when you check the code in service.js line 394:
There's nothing wrong with the code right? If I try to change line 394 to something like key : self.currentUser, there will be NO error and the app will work. What seems to be the problem here?
Not sure why you are making an object's attribute a list? If you want the key to be childQuestionSnapshot.key then remove the square brackets.
If you are trying to update a list of objects, you can do something similar to the below:
var test = [{key: 'thisguy'},{key: 'thatguy'},{key: 'myguy'}]
test.forEach(function(item){
item['key']='newguy'
})
console.log(test)
Do this instead
var updateObj = {};
updateObj[childQuestionSnapshot.key] = self.currentUser;
applicantRef.update(updateObj, function() {
console.log("applicant answers updated");
});
My app is generating this logcat message almost every second:
SurfaceTextureClient [STC::queueBuffer] (this:0x5e774a58) fps:2.00, dur:1496.57, max:499.96, min:498.21
and it's just a hello world with a custom logo in the actionbar and saves things in SharedPreferences. My activity layout is a LinearLayout with two edittexts and one button. No strange things.
This is the only style I use:
<style name="MyTheme" parent="#android:style/Theme.Holo.Light.DarkActionBar"></style>
I've searched in google but I have found nothing.
When I touch the button this appears:
Provider/Settings invalidate [system]: current 1 != cached 0
Provider/Settings from db cache, name = sound_effects_enabled , value = 0
It's annoying.
EDIT
Maybe is my smarphone. I've installed the same app in a tablet and the messages don't appear. Maybe I have touch something in settings? It's very strange. (My phone is a Jiayu 3gs with Android 4.2.1, but until today nothing wrong had happened).
Ok, the message appears in the general log so it's not associated with my app.
I'm starting to think that I have a virus. I have a lot of messages of this kind without doing anything in the phone:
ADB_SERVICES create_local_service_socket() name=shell:ls -l /
ADB_SERVICES adb: unable to open /proc/14420/oom_adj
ADB_SERVICES adb fdevent_process list (31) (20) (77)
ADB_SERVICES closing because is_eof=1 r=1 s->fde.force_eof=0
SurfaceFlinger [SurfaceFlinger] fps:2.002652,dur:1498.01,max:499.41,min:499.22
UsbDeviceManager onReceive - BATTERY_CHANGED - mPlugType: 2, mSettingUsbCharging: false, mConnected: true, mSettingUsbBicr: false
And I have a lot of files in my / with date creation of 1970-01-01 01:00. Files like init, init.modem.rc, init.rc, init.usb.rc, ..., emmc#android, ..
Maybe I'm just paranoid.
Furthermore I can't access to all options in "Developer options settings". This is all I can see:
Different phones have different kind and amount of log messages. Not much you can do about it, besides filtering the output based on the tag you use.
Im getting this error message. I created a new project and hit debug to test it. I added nothing and i get this pop up message. what could be my issue? I can create a new blank project wtih out the Controllers and Models projects in them it debugs just fine. But i need to use this solution provided to me.
New to mono droid any help will be apreciated.
You issue could be that none of the projects have been set to be deployed to a device.
Right click your Solution > Properties > Configuration Properties > Tick The Deploy checkbox for your Application Project if not already.
Also make sure to mark one of your activities with MainLauncher = true, otherwise Android does not know which Activity to start first. This is done in the [Activity()] attribute like so:
[Activity(Label = "Epic Activity", MainLauncher = true, Icon = "#drawable/icon")]
public class Activity1 : Activity {}
what could be my issue?
You are using Visual Studio... Android plays much nicer with Eclipse.
Kidding aside, every Android application requires an AndroidManifest.xml file. It looks like you are using MonoDroid, and there are docs about creating the manifest file.
Also, make sure you have built the project.
AndroidManifest.xml is generated as part of the build process, and the XML found within Properties\AndroidManifest.xml is merged with XML generated based on custom attributes.