Flutter Build Apk Error "Unresolved reference: snackbar" - android

I'm currently making an e-commerce project using flutter. I need a payment gateway to make transactions, so I install the "stripe_payment" package (https://pub.dev/packages/stripe_payment).
After I followed the installation steps, I run the "flutter run" command. The result is the package stripe can run well in my application.
However, when I run the "flutter build apk", an error appears as below:
The main errors are:
e: C:\Users\samue\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-1.0.5\android\src\main\kotlin\de\jonasbark\stripepayment\StripeDialog.kt: (6, 36): Unresolved reference: snackbar
When I open the C:\Users\samue\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\stripe_payment-1.0.5\android\src\main\kotlin\de\jonasbark\stripepayment\StripeDialog.kt file and I check line 6, I see inside the file importing import com.google.android.material.snackbar.Snackbar.
Then I looked for a solution on google, it looks like the problem is build.gradle. Here I attach the contents of the file from build.gradle
But I tried editing the build.gradle dependencies section that I got from Google, but all of them didn't work. When I run the flutter build apk, the same error still appears.

I have found the solution. I deleted the package "search_widget", then the package "stripe_payment" can run normally again without any errors during the build.
From this problem, I just understood that there are possibilities that packages on flutter can conflict, causing errors.

Related

Genrate Apk from React Native app , JDK Error

here is the error while building the signed apk
the following screenshot is the packages and version used within the app.
> Task :react-native-firebase_messaging:compileReleaseJavaWithJavac FAILED
An exception has occurred in the compiler (1.8.0_291). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)
for solving this issue , you should update your jdk and also keep your firebase libraries updated .
then run ./gradlew clean within Project's root and remove the build folder within app.
it should solve the issue!

Can not find the symbol R in running androidTests

I am trying to clone and run this project.
Catroid
I am unable to run the tests inside androidTests.
I have previously written tests for my project, but I can't seem to understand the problem with this one.
The steps I am following are:-
Cloning the repository.
Opening it in android studio,The app is running completely fine.
But when I try to run the tests(androidTests), It gives following errors:
Error:Can Not find the symbol R
Error:package R does not exist,and gives 72 such errors
One of those lines which is causing this error is this
Error Line
I have manually checked, R.java file for test resources is there in the project
This is the google group thread of the same
Google Group Discussion
I have tried cleaning, rebuilding, invalidating the cache, restarting.
I dont know what i am missing
ScreenShot of Error Message.

Android Studio Execution failed for task ':app:mergeDebugResources' with special chars in username

i have a strange error with AAPT2 iin Android Studio. I think it has something to do with german special characters in my account name in windows.
If i set my gradle to version 3.0.1 and also set android.enableAapt2 to false everything works fine. But since i researched, setting the option is not a solution to the problem.
Now if i set the gradle version to 3.1.2 and remove android.enableAapt2 from the properties i get the following error message:
And this one:
One way to solve the problem was to create a new account in windows without special chars in the name. It compiled and did run very well. I really tried everything in the web but could not find a solution to the problem.
Maybe you can help me.
First of all check your build log botom of the build section you shared whether any error related to your project showing or not. If error showing then fix those. Build and run again and fix all the error comes up. It will eliminate aapt2 issue without changing android gradle plugin.
Secondly if there is not any project related error showing in the build log but still its showing aapt2 error then you can fix it by following below steps.
Update your android gradle plugin in your project level build.gradle file like below:
classpath 'com.android.tools.build:gradle:3.2.0-alpha13'
Now update android.enableAapt2=true. Then check and build your project.

Gradle Build : error package does not exist

I was developing an android app (using Eclipse, not Studio) following some example, which makes use of Github/CircleImageView. Hence, I wanted to compile that first into a jar library.
So on my Linux machine I installed gradle and since its my first time with gradle, I followed the tutorial on gradle. So, in the root directory of the project ~/Downloads/CircleImageView-master/, I :
Run gradle wrapper. Got Build Success
Run ./gradlew build, gives the following error
CircleImageView.java:21: error: package com.nineoldandroids.animation does not exist
import com.nineoldandroids.animation.ObjectAnimator;
Though, I can see that there is one jar file in the project ~/Downloads/CircleImageView-master/circleimageview/libs/nineoldandroid-library-2.4.0.jar. Can anyone please help in resolving the issue. I am trying since past 10 hours and reached so far here after resolving all the issues, and stuck just at the last point.
I opened the jar in a package manager and the required classes are there, including ObjectAnimator.

Errors running builder 'CDT Builder' when trying to build OpenCV for android samples

Hello guys I'm trying to learn about openCV in android
I've already following the instruction given here
but when I'm trying to compile I'm only getting
01:50:14 ** Auto Build of configuration Default for project
org.opencv.samples.fd.FdActivity **
"C:\Android\android-ndk-r8\ndk-build.cmd" Install:
libdetection_based_tracker.so =>
libs/armeabi-v7a/libdetection_based_tracker.so
01:50:14 Build Finished (took 184ms)
in the console
and I'm also get an error
Errors occurred during the build. Errors running builder 'CDT Builder'
on project 'org.opencv.samples.fd.FdActivity'. Internal error building
project org.opencv.samples.fd.FdActivity configuration Default
java.lang.NullPointerException Internal error building project
org.opencv.samples.fd.FdActivity configuration Default
java.lang.NullPointerException
anyone ever encountered this problem before?
please help me to solve this problem
thank you
try
Project Properties>C/C++ Build>Tool Chain Editor
Current toolchain: Android GCC
Current builder: Android Builder
Project Properties>C/C++ Build
(uncheck) use default build command
Build command: ndk-build
(uncheck) generate Makefiles automatically
You may have renamed the project, and the eclipse forgot to rename the "Refresh Policy".
Just update "Project properties -> C/C++ Build -> Refresh Policy" manually solved my problem.
BTW, ADT has some very bad error descriptions as of in this case.
I might have the same problem,
try ndk-build -B which rebuild all the things, see whether you still got error,
if no error remain, there is no problem with your ndk-build. try to run your android apps without CDT installed, if this works, at least we could use comand line to build the c++ part of code.
but CDT is still not working well, after I install the CDT according to the opencv doc, I got lots of errors, add the cygwin and gcc things to the path would solved most of it. But the last things every strange is, I got an error here.
in the face detection sample, .cpp part
catch(cv::Exception e)
{
LOGD("nativeCreateObject catched cv::Exception: %s", e.what());
it always says symbol "e" can not be resolved.
but no error when I include the opencv things.
even when I try to put cv::Exception e outside of the catch()
These works for me:
Build command: ndk-build
(uncheck) generate Makefiles automatically

Categories

Resources