how to make a singed apk file with javafxPorts - apk

anybody here developers with javafxPorts?
I was interested in gluon project, but some of sample gluon mobile sources in eclipse plugin doesn't make a signed apk file to upload the Google play store.
if you succeed in making a signed apk file, please let me know the detail solution.
i'm sure it doesnt work.
1) install Eclipse Mars(4.5.2) + Gluon Tools (e(fx)clipse IDE 2.3.0, Gradle IDE 3.7.3..)
2) Gluon Sample project (all of them including Gluon Mobile - Single or Multi View Project)
3) it works about a debug apk file through gradle, but not a release signed apk file.
is it wrong???
jfxmobile {
android {
manifest = 'src/android/AndroidManifest.xml'
androidSdk = 'F:/android/android-sdk'
signingConfigs {
release {
storeFile file("mykey.keytool"))
storePassword "test"
keyAlias "kdc"
keyPassword "test"
}
}
}
}
what is that mean??
No such property: manifest for class: org.javafxports.jfxmobile.plugin.android.task.AndroidTask_Decorated
[BUILD FAILED]
please help me..

In the jfxmobile plugin there is no support for multiple configurations. The android task (which generates a debug apk) will always be signed with a debug keystore. To generate a signed release apk, you directly specify the signingConfig configuration and use the androidRelease task.
jfxmobile {
android {
manifest = 'src/android/AndroidManifest.xml'
signingConfig {
storeFile file('my.keystore')
storePassword 'storePass'
keyAlias 'alias'
keyPassword 'keyPass'
}
}
}
Notice that I didn't specify a name for the signing configuration.

Related

Why do I get "no manifest." and "jar is unsigned." when doing "jarsigner -verify -verbose -certs" for my APK

I have one of my Android projects producing unsigned APKs. I'm using below provided configuration and then verifying produced APKs.
I'm sure Gradle is using my provided keystore file because I tried changing the path and password and the build was failing.
APKs are not signed after all
jarsigner -verify -verbose -certs /Users/viliuskraujutis/.../path-to-newly-created.apk
The output is this:
s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
no manifest.
jar is unsigned.
Signing from build.gradle
For the context I'm signing like this:
android {
...
signingConfigs {
release {
storeFile file("my-key-used-in-other-successful-project.keystore")
storePassword "my-password-used-in-other-successful-project"
keyAlias "my-alias-used-in-other-successful-project"
keyPassword "my-password-used-in-other-successful-project"
}
}
You likely have a minSdkVersion of 24 or higher. If that's the case then AGP uses a more efficient signing scheme called "V2 signing" and because all Android devices on 24+ support this scheme, it is no longer needed to sign with "v1 scheme" (i.e.jar signing). V2 scheme is completely independent of jar signing, that's why jarsigner thinks the APK is unsigned. If you use apksigner (provided in Android tools), then you can check that your APK is in fact correctly signed.
The problem was as #Pierre posted yesterday - the minSdk version was 30, and since it's >23 - it uses v2/v3 signing scheme by default.
For maximum compatibility, we decided to use multiple signing schemes as per android.com recommendation.
And the fix for the app/build.gradle was that simple - we have set v1SigningEnabled and v2SigningEnabled to true. Like this:
signingConfigs {
release {
storeFile file('...')
storePassword '...'
keyAlias '...'
keyPassword '...'
v1SigningEnabled true
v2SigningEnabled true
}
}

Android Studio Execution failed for task ':app:dexDebug'

I'm trying to start my first Android Studio app and coming across the same error over and over when I try to run or debug. I'm building a music app using the Spotify API and have imported the zipped jar files in the correct directory (under libs in my app).
What seems to be the problem is that maybe my SDK folder is in another drive? I don't think so, but it was the only thing I can think it would be. I even moved over my Android Studio folder and tried running it from the same D: drive but didn't make any difference.
I also have all the appropriate SDKs installed incl. SDK Tools, Platform-tools, SDK Build-tools 19.1, 20, API 19, 20, Android Support Repository, Library, Google Play serivces, Repository, USB Driver, and Intel Emulator.
This is the error I am getting:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
D:\adt-bundle-windows-x86_64-20140702(2)\adt-bundle-windows-x86_64-20140702\sdk\build-tools\19.1.0\dx.bat --dex --output C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\dex\debug C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\classes\debug C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\dependency-cache\debug C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\exploded-aar\com.spotify.sdk\spotifysdk\1.0.0-beta5\libs\jnihelpers-1.0.jar D:\adt-bundle-windows-x86_64-20140702(2)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\m2repository\com\android\support\support-v4\19.0.1\support-v4-19.0.1.jar C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\exploded-aar\com.spotify.sdk\spotifysdk\1.0.0-beta5\classes.jar C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\19.0.1\classes.jar
Error Code:
1
Output:
'D:\adt-bundle-windows-x86_64-20140702' is not recognized as an internal or external command,
operable program or batch file.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Here is some my code and gradle builds/props:
local.properties
sdk.dir=D\:\\adt-bundle-windows-x86_64-20140702(2)\\adt-bundle-windows-x86_64-20140702\\sdk
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0' // Note: this version should match the latest build-tools version
// that you installed in the SDK manager
defaultConfig {
applicationId "com.jesse.spalding.subrosa"
minSdkVersion 14
targetSdkVersion 19
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
dexOptions {
preDexLibraries = false
}
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.spotify.sdk:spotifysdk:1.0.0-beta5#aar'
compile 'com.android.support:appcompat-v7:19.0.1'
}
If anyone has any idea what the deal is what this, please let me know. I need to start working on this for a final project and just can't figure this technical thing out for some reason.
The problem seems to be that your SDK is in a path that has a parenthesis in it (D:\adt-bundle-windows-x86_64-20140702(2)\adt-bundle-windows-x86_64-20140702\sdk), which is causing problems in one of the phases of the build process. Move your SDK to a path with a simpler name and update its location in Android Studio (Project Structure > SDK Location) and you should be good to go.

Gradle error on Android Studio startup

Every time I start Android Studio I get the following error:
Gradle 'VertretungsplanProject' project refresh failed: Could not
fetch model of type 'IdeaProject' using Gradle distribution
'http://services.gradle.org/distributions/gradle-1.6-bin.zip'. A
problem occurred configuring project ':Vertretungsplan'. A problem
occurred configuring project ':Vertretungsplan'. Failed to notify
project evaluation listener. A problem occurred configuring project
':libraries:actionbarsherlock'. Failed to notify project evaluation
listener. Could not normalize path for file
'P:\Projekte\VertretungsplanProject\libraries\actionbarsherlock:Vertretungsplan\libs\android-support-v4.jar'.
The syntax for the filename, directoryname or the volume label is
wrong
My project looks like this:
Gradle settings:
build.gradle of :Vertretungsplan:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/commons-io-2.4.jar')
compile project(':libraries:actionbarsherlock')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 16
}
}
build.gradle of :VertretungsplanProject is empty.
build.gradle of :actionbarsherlock:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android-library'
dependencies {
compile files(':Vertretungsplan/libs/android-support-v4.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
When I want to compile now this error appears:
Deprecated make implementation
Old implementation of "Make" feature is enabled for this project.
It has been deprecated and will be removed soon.
Please enable newer 'external build' feature in Settings | Compiler.
After changing this setting to Use external build everything is working fine.
But this appears every time I start Android Studio and this is really annoying.
UPDATE
I deleted the android-support-v4.jar from the libs folder and simply wrote compile 'com.android.support:support-v4:18.0.0' to the build.gradle of ActionbarSherlock. Then the android-support-v4.jar is used from the installed SDK.
EDIT
Go to File > Settings > "Build,Execution,Deployment"> Compiler
Click compiler directly.
Check the option: Use external build > Apply > OK.
It worked for me !! :)
You seem to have more than one issue. Problems loading gradle on startup and problems resolving the dependency path name in your environment.
I recently found a fix for the "Failed to import Gradle project" issue, which could be linked to your dependency issue.
At least if you fix one, you know your issue could specifically be the dependency path resolution rather than a gradle/android studio issue...
Check out the troubleshooting section here:
http://developer.android.com/sdk/installing/studio.html#Troubleshooting
The basic steps are:
1. Close android studio
2. Open the SDK manager
(run android binary/executable which should be in /tools)
3. Scroll down the list and expand extras
4. Tick the "Android Support Repository"
5. Click Install Packages.. etc etc...
You need to download this as Android Studio 0.2.x needs a new maven repository used by the new build system for the support library, instead of using support library jar's.
Let us know if anything changes after trying this fix.
In the error message, the path appears: 'P:\Projekte\VertretungsplanProject\libraries\actionbarsherlock\:Vertretungsplan\libs\android-support-v4.jar'
It looks like you're on Windows. The semicolon before Vertretungsplan is not a legal filesystem character. This appears in your script as
compile files(':Vertretungsplan/libs/android-support-v4.jar')
Try changing this to
compile files('Vertretungsplan/libs/android-support-v4.jar')

Gradle/Android: Specify 'root' as a dependency of subproject

First of all, I've got an Android Studio project setup that works fine from within Studio. I can build it and run it on a device and in the emulator without problem and can also build a release APK.
I'm now trying to get to the point where I can have some command-line tools that will handle my build for me. All the reading I've done suggests that Android Studio uses gradle, but from what I've seen that's clearly not the case for my project -- as I had to create my build.gradle, settings.gradle files before gradlew would even attempt to build anything -- and yet Android Studio could still compile and deploy just fine.
Here's my project structure (as it sits physically on disk):
Root Project (Android library project, contains all the src, logic, UI, activities, etc.)
\--- WrapperProject (Android app, depends on the root project)
\--- SubProject1 (Android library, used by root)
\--- SubProject2 (Android library, used by root)
This is my root project's settings.gradle file
include ':SubProject1', ':SubProject2'
Likewise, here's my root project's build.gradle file. Note that this project is marked as an android-library and does not reference the WrapperProject in any way (should it?)
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android-library'
dependencies {
compile project(':SubProject1')
compile project(':SubProject2')
}
android {
compileSdkVersion 17
buildToolsVersion "17"
defaultConfig {
minSdkVersion 9
targetSdkVersion 17
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
I'm able to build my root project successfully using gradlew build -- but my ultimate goal is to build the APK from the WrapperProject that has a dependency on the root project. Can you suggest what my WrapperProject's build.gradle file should contain?
I'm here because of searching for similar answers, although my problem is primarily the opposite. I'm finding that the integration between command-line builds (gradlew) and Android Studio 0.2.2 is full of secrets.
One thing I see that stands out in your config file: this is pretty beta/alpha stuff. You have not revised your project to the latest Android Studio 0.2.0 notes. In particular, the 'com.android.tools.build:gradle:0.4' should be revised. Reference: http://tools.android.com/recent
There is an open source application that has the same basic need as yours. It is a Grocery Shopping app that is provided as a sample for CouchDBLIte https://github.com/couchbaselabs/GrocerySync-Android
it has to reference the existing projects. It seems to use a more explicit syntax for the dependencies than you did. example: "compile 'com.couchbase.cblite:CBLiteEktorp:0.7.4'" - including the full class paths. But they define two basic approaches, direct integration and artifact integration.
Sorry I can't provide a more precise answer to your syntax issue - but I'm sharing what I know so far.

Android Studio update today with regression

Started Android Studio today, and it popped up an update notice. Since I'm eager to explore new features and bug fixes, I clicked yes. Now the Project Structure dialog where you setup dependencies is missing, and has been replaced by a message:
We will provide a UI to configure project settings later. Until then, please manually edit your build.gradle file(s.)
So, I go out to try to figure out how to add ActionBarSherlock to my project as a project dependency, and have hit a brick wall. I have no idea how to import ActionBarSherlock project as a Library Project, and configure my project to use it. There isn't much documentation on this at Google, IntelliJ, and the Gradle docs assume a LOT of pre-existing knowledge of build systems.
There are plenty of posts on SO how to do this (although referenced with already missing Project structure dialog)
How do I add a library project to Android Studio?
Android-Studio ActionBar sherlock error with gradle
Installing ActionbarSherlock with Android Studio?
Problems importing project into Android Studio regarding ActionBarSherlock
In short:
Create a folder (i.e. /libraries) in your root.
Extract actionbarsherlock there
Create a new file build.gradle in actionbarsherlock root with the following contents
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android-library'
dependencies {
compile files('libs/android-support-v4.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
In your project's build.gradle
dependencies {
//NOTE that "libraries" is actually a folder name you created in step 1
compile project(":libraries:actionbarsherlock")
//Any other dependencies here
//Make sure there is no android-support-v4.jar in this build file
//as it is already contained in actionbarsherlock project
}
In settings.gradle
//NOTE that "libraries" is actually a folder name you created in step 1
include ':libraries:actionbarsherlock', ':<Your project name>'
EDIT
Last step: Close your project and open it back again for Studio to pick up the Intelli-sense data

Resources