codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.
https://www.codenameone.com/
Other
1.72k stars 408 forks source link

CN1 build server always providing a faulty buildscript #2843

Open kutoman opened 5 years ago

kutoman commented 5 years ago

This is what the respective part of build.gradle looks like:

apply plugin: 'com.android.application'

buildscript {
    repositories {
     jcenter()
     mavenLocal()
      mavenCentral()
      google()
     mavenLocal()
      mavenCentral()
      google()
    }
    dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
    }
} 

As you can see there are duplicated lines. Moreover I can't run the provided android project instantly because I get the following error:

Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.1).
Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.0.1/manifest-merger-26.0.1.jar

It gets fixed after having a proper buildscript section:

buildscript {
    repositories {
        google()
         jcenter()
         mavenLocal()
          mavenCentral()
    }
    dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
    }
}
codenameone commented 5 years ago

What build hints do you have?

kutoman commented 5 years ago

sorry for the delay (I was on vacation). This is the content of my cn1 settings.properties (obfuscated):

#Fri Aug 02 11:16:56 CEST 2019
codename1.ios.appid=appID
codename1.ios.release.provision=production_provisioning_profile.mobileprovision
codename1.arg.java.version=8
codename1.arg.ios.objC=true
codename1.arg.ios.newStorageLocation=true
codename1.j2me.nativeTheme=nbproject/nativej2me.res
codename1.arg.ios.statusBarFG=UIStatusBarStyleLightContent
codename1.displayName=AppName
guiResource=theme.res
codename1.arg.ios.pods.platform=,7.0
codename1.android.keystoreAlias=Alias
codename1.arg.android.xapplication=<meta-data android\:name\="com.google.android.maps.v2.API_KEY" android\:value\="ABC"/>
codename1.ios.release.certificate=appstore_certificate.p12
codename1.android.keystorePassword=Pwd
codename1.ios.provision=
codename1.arg.ios.glAppDelegateHeader=\n\#import "GoogleMaps/GoogleMaps.h"
package=generated
codename1.arg.ios.statusbar_hidden=true
codename1.arg.ios.afterFinishLaunching=[GMSServices provideAPIKey\:@"ABC"];
codename1.cssTheme=true
codename1.languageLevel=5
codename1.android.keystore=Publish.jks
mainForm=Main
codename1.arg.ios.pods=,GoogleMaps
codename1.vendor=CodenameOne
codename1.arg.javascript.googlemaps.key=ABC
codename1.arg.ios.locationUsageDescription=Some functionality of the application depends on your location
codename1.arg.android.playService.maps=true
codename1.ios.certificatePassword=
codename1.arg.android.versionCode=204
codename1.ios.debug.certificatePassword=Pwd
codename1.arg.android.GoogleMaps.minPlayServicesVersion=9.4.0
codename1.mainName=AppName
codename1.arg.android.enableProguard=false
codename1.arg.ios.pods.sources=,https\://github.com/CocoaPods/Specs.git
codename1.ios.release.certificatePassword=Pwd
codename1.ios.debug.certificate=development_certificate.p12
codename1.arg.android.xpermissions=<uses-permission android\:name\="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android\:name\="com.google.android.providers.gsf.permission.READ_GSERVICES"/><uses-feature         android\:glEsVersion\="0x00020000"         android\:required\="true"/>
codename1.secondaryTitle=AppTitle
codename1.ios.debug.provision=development_provisioning_profile.mobileprovision
baseClass=src/generated/StateMachineBase.java
codename1.arg.build.incSources=1
codename1.rim.certificatePassword=
codename1.version=2.01
codename1.ios.certificate=
codename1.arg.ios.bundleVersion=2.6
codename1.icon=icon.png
codename1.rim.signtoolCsk=
codename1.rim.signtoolDb=
userClass=src/userclasses/StateMachine.java
codename1.arg.ios.includePush=true
codename1.packageName=packageName
codenameone commented 5 years ago

I'm guessing the manifest merge issue relates to your android.xpermissions setting. I'm not sure why all of those are there to begin with.

kutoman commented 5 years ago

you mean these two permissions?

android.permission.ACCESS_NETWORK_STATE
com.google.android.providers.gsf.permission.READ_GSERVICES
codenameone commented 5 years ago

Possibly. It's hard to guess with a partial build error. We return the exact script that worked for us while compiling, unfortunately gradle/Android Studio are a bit flaky.