Android builds failing with compilation errors - codenameone

Im trying to build my app for android. It is setup for notifications. If I build with version 3.4 it gets the following error:
/tmp/x/WordTime1/src/main/java/com/codename1/impl/android/AndroidImplementation.java:4576: error: cannot find symbol
notification.setLatestEventInfo(activity, contentTitle, contentBody, contentIntent);
^
symbol: method
setLatestEventInfo(Activity,String,String,PendingIntent)
location: variable notification of type Notification
/tmp/x/WordTime1/src/main/java/com/codename1/impl/android/PushNotificationService.java:110: error: cannot find symbol
notif.setLatestEventInfo(this, value, "", contentIntent);
^
symbol: method setLatestEventInfo(PushNotificationService,String,String,PendingIntent)
location: variable notif of type Notification
If I build with latest, it gets this error:
/tmp/x/WordTime1/src/main/java/com/codename1/social/GoogleImpl.java:112: error: cannot find symbol
GoogleSignInAccount acct = result.getSignInAccount();
and many more from the com/codename1/social package.
Thank you
Sam

You should build with the latest as 3.4 is ancient by now (we are past 3.8).
The problem with the Google Signin relates to the old Google Plus login support which Google removed. You need to remove the build hints related to that and switch to the new Google Login functionality mentioned in the developer guide.
I mentioned the problems with the Google Connect switch in the blog a while back.

Related

AWS-sdk contributes to Build Error "Uncaught TypeError: e is not a constructor"

My react application is working fine until I wanted to wrap it up and deploy it. The build via vite build is successful. However, when the built folder "dist" is deployed and served, it says Uncaught TypeError: e is not a constructor.
After hours of debug, I can confirm that it's the aws-sdk that is causing the issue. In particular, the following code:
const s3 = new S3({
accessKeyId: VITE_ACCESS_KEY_ID,
secretAccessKey: VITE_SECRET_ACCESS_KEY,
region: VITE_REGION,
});
I think the new S3(...config) here corresponds to a line that reads o = new e; in the compiled index.bad38efb.js file that gives the Uncaught TypeError: e is not a constructor error.
Ultimately the question comes down to, is there any alternative that I could authenticate with s3 or does anyone know how to resolve this problem? Please let me know what extra information could I provide to answer the question.
Had the same issue, although harder to debug since I was not getting any errors in building.
Solution is to move to the v3 version of the SDK which is better maintained (and has other benefits too).

android build error on codenameone with braintree payments

when I add braintree extension to my codenameone project and send android build to codenameone I got build error with these error log:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'NLApplication'.
Could not resolve all dependencies for configuration ':_debugCompile'.
Could not find com.android.support:cardview-v7:26.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
https://jcenter.bintray.com/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
file:/tmp/build2388050053529696565xxx/NLApplication/libs/cardview-v7-26.0.0.jar
file:/tmp/build2388050053529696565xxx/NLApplication/libs/cardview-v7.jar
file:/home/ec2-user/android-sdk/extras/android/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
file:/home/ec2-user/android-sdk/extras/android/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
file:/home/ec2-user/android-sdk/extras/google/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.pom
file:/home/ec2-user/android-sdk/extras/google/m2repository/com/android/support/cardview-v7/26.0.0/cardview-v7-26.0.0.jar
Required by:
:NLApplication:unspecified > com.braintreepayments.api:drop-in:3.1.0
Could not find com.android.support:design:26.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/design/26.0.0/design-26.0.0.pom
https://jcenter.bintray.com/com/android/support/design/26.0.0/design-26.0.0.jar
file:/tmp/build2388050053529696565xxx/NLApplication/libs/design-26.0.0.jar
file:/tmp/build2388050053529696565xxx/NLApplication/libs/design.jar
file:/home/ec2-user/android-sdk/extras/android/m2repository/com/android/support/design/26.0.0/design-26.0.0.pom
file:/home/ec2-user/android-sdk/extras/android/m2repository/com/android/support/design/26.0.0/design-26.0.0.jar
file:/home/ec2-user/android-sdk/extras/google/m2repository/com/android/support/design/26.0.0/design-26.0.0.pom
file:/home/ec2-user/android-sdk/extras/google/m2repository/com/android/support/design/26.0.0/design-26.0.0.jar
Required by:
:NLApplication:unspecified > com.braintreepayments.api:drop-in:3.1.0 > com.braintreepayments:card-form:3.1.0
It seems that Braintree pushed out a 3.1 update with an odd new dependency that fails. I've restricted gradle to use 3.0 and will push out an updated cn1lib. This should appear as an update in your extension manager later today. However, if you have the cn1lib already installed you will need to first delete the build hint android.gradleDep then do a refresh cn1libs.

Using library with Google play service vision

I am trying to add a library that uses google play service vision. My library works well on a native android project as long as I add the play service vision lib to the app. I have added the following build hints in a Codename One project:
With that build hint i have the following build error:
/tmp/build731648870085799025xxx/MyApplication/build/intermediates/res/merged/debug/values/values.xml:64: AAPT: Error retrieving parent for item: No resource found that matches the given name 'ThemeOverlay.AppCompat.Dark.ActionBar'.
/tmp/build731648870085799025xxx/MyApplication/build/intermediates/exploded-aar/materialbarcodescanner-release/res/values/values.xml:9:5-12:13: AAPT: No resource found that matches the given name: attr 'windowActionBar'.
/tmp/build731648870085799025xxx/MyApplication/build/intermediates/exploded-aar/materialbarcodescanner-release/res/values/values.xml:9:5-12:13: AAPT: No resource found that matches the given name: attr 'windowNoTitle'.
/tmp/build731648870085799025xxx/MyApplication/build/intermediates/res/merged/debug/values/values.xml:69: AAPT: Error retrieving parent for item: No resource found that matches the given name 'ThemeOverlay.AppCompat.Light'.
That issue is not related to the google play service lib: I have the same issue when I try to use a simple library that just uses a toastbar. Perhaps android studio generated some resources that can not be used in codename one ?
When I try to change the google play service version with the following build hint:
The google play service lib is not found anymore:
Could not find com.google.android.gms:play-services-vision:10.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-vision/10.0/play-services-vision-10.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-vision/10.0/play-services-vision-10.0.jar
file:/tmp/build3506878302752944909xxx/MyApplication/libs/play-services-vision-10.0.jar
file:/tmp/build3506878302752944909xxx/MyApplication/libs/play-services-vision.jar
file:/home/ec2-user/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-vision/10.0/play-services-vision-10.0.pom
file:/home/ec2-user/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-vision/10.0/play-services-vision-10.0.jar
file:/home/ec2-user/android-sdk/extras/google/m2repository/com/google/android/gms/play-services-vision/10.0/play-services-vision-10.0.pom
file:/home/ec2-user/android-sdk/extras/google/m2repository/com/google/android/gms/play-services-vision/10.0/play-services-vision-10.0.jar
Required by:
:MyApplication:unspecified
How can I change the google play service version and how can I add my libraries properly ?
Change the android.playServicesVersion to 10.0.0 or 10.0.1. Either of those should work.

"cannot find symbol method setBatchPath(String)" in the generated source from generated endpoint

For an unknown reason, when I tried to build my Google App Engine endpoints, I get these errors in all of the API java files generated by Android Studio:
Error:(400, 5) error: method does not override or implement a method from a supertype
Error:(402, 29) error: cannot find symbol method setBatchPath(String)
I did some initial troubleshooting and found out that there's a Builder class inside the java file and it extends AbstractGoogleJsonClient.Builder. I looked at the source for the Builder class and I cannot find the method.
Why all of the sudden am I getting these errors? Help!
Same thing happened to me this morning.
I resolved it by adding this in my backend project
appengine {
endpoints {
googleClientVersion = '1.23.0'
}
}
and updating this version in my app gradle file.
implementation('com.google.api-client:google-api-client-android:1.23.0')
Faced the same problem. I upgraded google client libs to 1.23.0 and it worked (earlier was 1.22.0)
compile 'com.google.api-client:google-api-client:1.23.0'
compile 'com.google.http-client:google-http-client-android:1.23.0'
We already had these in our backend build.gradle:
dependencies {
compile 'com.google.api-client:google-api-client:+'
compile 'com.google.api-client:google-api-client-android:+'
compile 'com.google.http-client:google-http-client:+'
compile 'com.google.http-client:google-http-client-android:+'
}
All we needed was adding:
appengine {
endpoints {
googleClientVersion = '1.23.0'
}
}
But it'd have been nice if Google didn't break our codes every once in awhile out of the blue and wasting hours of development time!

Cannot get initial React Native App to Run

Description
I can't get an initial React Native app to run, following a basic tutorial. The error seems to have to do with UIUserInterfaceIdiomCarPlay.
Reproduction Steps and Sample Code
Following the tutorial here https://facebook.github.io/react-native/releases/0.23/docs/tutorial.html#content
I created a new React Native project react-native init AwesomeProject
Then went into the directory, and ran react-native run-ios
Note I also tried from Xcode, and the myriad fixes online, but still no dice. This is the error I got:
/Users/lauracressman/Desktop/AwesomeProject/node_modules/react-native/React/Base/RCTPlatform.m:26:10: error: use of undeclared identifier 'UIUserInterfaceIdiomCarPlay'; did you mean 'UIUserInterfaceIdiomPad'?
case UIUserInterfaceIdiomCarPlay:
^~~~~~~~~~~~~~~~~~~~~~~~~~~
UIUserInterfaceIdiomPad
In module 'UIKit' imported from /Users/lauracressman/Desktop/AwesomeProject/node_modules/react-native/React/Base/RCTPlatform.m:12:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h:33:5: note: 'UIUserInterfaceIdiomPad' declared here
UIUserInterfaceIdiomPad NS_ENUM_AVAILABLE_IOS(3_2), // iPad style UI
^
/Users/lauracressman/Desktop/AwesomeProject/node_modules/react-native/React/Base/RCTPlatform.m:26:10: error: duplicate case value 'UIUserInterfaceIdiomPad'
case UIUserInterfaceIdiomCarPlay:
^
/Users/lauracressman/Desktop/AwesomeProject/node_modules/react-native/React/Base/RCTPlatform.m:22:10: note: previous case defined here
case UIUserInterfaceIdiomPad:
^
2 errors generated.
Additional Information
React Native version: 0.42.3
Platform: iOS
Development Operating System: MacOS
Dev tools: Xcode, command line
Someone was recently facing the same problem with that error message Use of undeclared identifier 'UIUserInterfaceIdiomCarPlay'; did you mean 'UIUserInterfaceIdiomPad'?. He commented out lines 26 & 27 from node_modules/react-native/React/Base/RCTPlatform.m and apparently got it to work. It might be related to using an outdated version of Xcode

Resources