I'am following a tutorial from here https://github.com/google-pay/android-quickstart , i downloaded the code and try to run it but it complains about
package com.google.android.gms.samples.wallet.databinding does not exist
which is logically true , as the package does not exist , but i assume downloading from the official site i should not be facing such problem.
I have not changed anything from the link i just downloaded and ran it in my Android studio. how do i resolve this??
Please help.
Versions
Android Studio version : 4.01
Android Version : 7.1.2
google-play : 2020.10.22037
I contacted Google for the same issue, and was told
The class is generated from View binding. View binding is enabled from build.gradle (you can find it from github as well)
viewBinding {
enabled =
true
}
And given this link to the relevant documentation.
Related
I have in the past successfully implement the Google AdMob, but this time with a new project, it's impossible!
I have error with Google AdMob integration in a blank Xamarin.Forms project.
In the standard project :
Have theres Nuget packages already installed :
NETStandard.Library 2.0.3
Xamarin.Essentials 1.3.1
Xamarin.Forms 4.4.0.991265
Create AdmobControl class
In the MainPage.xaml.cs add the AdmobControl with the banner ad id for Android TEST : "ca-app-pub-3940256099942544/6300978111"
In the Android project :
Have theres Nuget packages already installed :
Xamarin.Essentials 1.3.1
Xamarin.Forms 4.4.0.991265
Then install the Nuget package Xamarin.Firebase.Ads 71.1601.0
In the MainActivity, inititialize Ads before Xamarin.Forms.Init, with App id for Android TEST : "" -> empty string
Add ACCESS_NETWORK_STATE permission
Add INTERNET permission
Add the line in the AndroidManifest.xml between the tag
Create AdMobRenderer class
The problem :
The compilation is ok BUT, when I deploy on app on my device, I have 2 errors :
error: MediationRewardedVideoAdListenerImplementor is not abstract and does not override abstract method zzc(Bundle) in MediationRewardedVideoAdListener
public class MediationRewardedVideoAdListenerImplementor TestAdMob.Android C:\Users\TheFloods\source\repos\TestAdMob\TestAdMob\TestAdMob.Android\obj\Debug\90\android\src\mono\com\google\android\gms\ads\reward\mediation\MediationRewardedVideoAdListenerImplementor.java 4
JAVAC0000: error: MediationRewardedVideoAdListenerImplementor is not abstract and does not override abstract method zzc(Bundle) in MediationRewardedVideoAdListener
public class MediationRewardedVideoAdListenerImplementor 0
Source code available here : https://github.com/TheFloods/XamarinTestAdMob
I have try following theres tutorials :
https://www.codeproject.com/Tips/1275283/Xamarin-Forms-Integration-with-Google-Admob
https://montemagno.com/xamarinforms-google-admob-ads-in-android/
https://xamarinhelp.com/admob-xamarin-forms-display-google-ads-mobile-app/
Others informations :
Visual Studio Community 2019 16.5.4
Windows 10 PRO 1803
Thank you for your help.
Thank you for your help you two.
I have solved the problem like this :
Uninstall the Xamarin.Firebase.Ads
Install the Xamarin.Firebase.Ads.Lite
Add the app ip in the AndroidManifest.xml, after the activity tag
Install the Xamarin.GooglePlayServices.Ads.Lite, then it works!
The project is in Xamarin android native. After updating firebase to 71.1740 in which Token is replaced by getToken().
Tried all the possible solution but didn't work. FirebaseInstanceId.Instance always return null.
And can't get the token. Any help is appreciated.
Verified google-service.json
Tried the same in android studio and worked fine but not working in xamarin.
FirebaseApp.InitializeApp(this);
FirebaseInstanceId.Instance.getInstance().AddOnCompleteListener(this);
The Instance is null.
Also written
Update
Xamarin.Firebase.Messaging to version 71.1740.1
And add this to yourproject.android.csproj
<PropertyGroup>
<AndroidManifestMerger>manifestmerger.jar</AndroidManifestMerger>
</PropertyGroup>
(more info)
This works for me (not sure if both are mandatory)
I was trying to create Android build after exporting from Unity Project.
When I tried to export signed APK file, I got many errors and step by step , I have cleared all others.
But at present, get stuck on this one :
This is my Gradle file content :
I have tried Stackoverflow posts with similar problems. So I expect some other solution that work for me.
It seem it's an old post , but i m writing down here a solution it may help somebody else to solve this issue
In your app gradle (Kotlin DSL), add this block :
android {
//...
packagingOptions {
exclude("META-INF/kotlin-stdlib-common.kotlin_module")
exclude("META-INF/kotlin-stdlib-jdk7.kotlin_module")
exclude("META-INF/kotlin-stdlib-jdk8.kotlin_module")
exclude("META-INF/kotlin-stdlib.kotlin_module")
exclude("kotlin/annotation/annotation.kotlin_builtins")
exclude("kotlin/collections/collections.kotlin_builtins")
exclude("kotlin/coroutines/coroutines.kotlin_builtins")
exclude("kotlin/internal/internal.kotlin_builtins")
exclude("kotlin/kotlin.kotlin_builtins")
exclude("kotlin/ranges/ranges.kotlin_builtins")
exclude("kotlin/reflect/reflect.kotlin_builtins")
}
// ....
}
This will fix the build error.
When building a project I get the following error:
Flavor 'nativescript-telerik-ui' has unknown dimension 'nativescript-telerik-ui'.
It happens only when using the pro version through the #progress registry. Doesn't happen with the local .tgz pro version.
I noticed the error has to do with the include.gradle file it generates. I read the following article: https://docs.nativescript.org/plugins/plugins#includegradle-specification
It says that when the plugin doesn't have the include.gradle, at build time gradle creates a default one with default elements. When I saw the include.gradle it generated for the plugin it seems to have generated a default one like so:
android {
productFlavors {
"nativescript-telerik-ui" {
dimension "nativescript-telerik-ui"
}
}
}
The include.gradle generated for the local .tgz version of the plugin is like this:
android {
productFlavors {
"F6" {
dimension "nativescripttelerikuipro"
}
}
}
I replaced the default include.gradle with the latter and it got past the error. You can recreate the problem by following these steps:
create a new hello world app
use the command npm login --registry=https://registry.npm.telerik.com/ --scope=#progress to log in if you're a paying customer.
use the command npm install --save #progress/nativescript-telerik-ui-pro to install the plugin
use tns run android
Is there anything I can do to solve this problem? Really need help on this.
My name is Vladimir and I am part of the nativescript-telerik-ui-pro team. Thank you for logging this issue in our feedback portal. We are going to review it as soon as possible and update you regarding its status, but from what I currently see there is some incorrect "parameters" passed to the 'pro' version of the plugin that are going to be resolved very fast.
We apologize for any inconvenience that this is causing.
I am trying to run the sample from :
http://developer.android.com/training/displaying-bitmaps/display-bitmap.html
However I encountered lots of errors like:
Description Resource Path Location Type
BuildConfig cannot be resolved to a variable ImageGridFragment.java /ImageGridActivity/src/com/example/android/bitmapfun/ui line 124 Java Problem
Description Resource Path Location Type
SuppressLint cannot be resolved to a type Utils.java /ImageGridActivity/src/com/example/android/bitmapfun/util line 99 Java Problem
I ran thru Google but could get nothing. Adjusted the android build target to 4.0.3 (15) but still no clue. Anyone ran this sample successfully?
Thanks.
Here is my solution:
1.Create a new class:
package com.example.android.bitmapfun;
public class BuildConfig {
public static final boolean DEBUG = true;
}
2.Comment the lines that contain "SuppressLint":
//import android.annotation.SuppressLint;
// #SuppressLint("NewApi")
Android developer tools r17 brings a feature to Eclipse where a class is auto built at build-time, called BuildConfig, which contains a constant that can be used by the app developer to sense whether the build is a dev build or a production build. This feature appears to be in the Eclipse integration support, so when using IntelliJ, this useful feature is not available
In gen folder with R.java there should be BuildConfig.java if your program compiled successfully.
/** Automatically generated file. DO NOT MODIFY */
package com.example.android.bitmapfun;
public final class BuildConfig {
public final static boolean DEBUG = true;
}
Clean your project and try to launch it again.
It worked for me.
For me also it is not running directly import to eclipse. Just i put comments which lines is showing errors then it is working fine for me. May be it is not a right answer but we can see the application functionality by running the code so i did like that.