Profile

Cover photo
Werner Dittmann
Works at Self-employed
Lived in München
15,180 views
AboutPostsPhotosVideos

Stream

 
+Alex Ruiz  I'm using AS 0.8.1, beta channel, and try to get some device screen shots from a connected (via USB) device. This used to work in previous versions/builds of AS. Now I get the following error message from my beloved AS:

Unexpected error while obtaining screenshot: java.lang.IllegalStateException:@NotNull method com/android/tools/idea/ddms/screenshot/DeviceArtDescriptor.getArtDescriptor must not return null

Is it a known problem? The connected devices are Nexus 4 (4.4.3) or Nexus 5 (4.4.4)
1
Tor Norbye's profile photoAlex Ruiz's profile photoWerner Dittmann's profile photo
3 comments
 
Thanks. I think I can wait for 0.8.2 :-) .
Add a comment...

Werner Dittmann

Gradle Build System  - 
 
+Xavier Ducrohet 
In a project I've created build flavors and copied the manifest into the right location of the flavor directory. The idea is that gradle merges this manifest with the main manifest. Unfortunately that doesn't work. I get the error message:
'Trying to merge incompatible /manifest/application/provider'

I just try to have another android:authorities string in the manifest to avoid a provider authorities clash if I install various flavors.

I found a very old posting in Google groups (May 2013, https://groups.google.com/forum/#!msg/adt-dev/K29pY0H9vsY/MXdu0CGj6SwJ ) where Xavier said that they haven't looked into 'provider merging' but will be soon :-) .

Seems that this is not yet fixed? If I'm not mistaken it is not possible to define the provider authority otherwise because the Android PM checks this during package installation. Any ideas about this topic?
1
Xavier Ducrohet's profile photo
 
Looks like you have the same provider node in both the main manifest and the one from the flavor? Just remove the one from the main manifest. Right now we can't merge the nodes if they are not exactly the same. This is something we are now actively working on.
Add a comment...
 
In one of my projects I sub-class ImageView. AS shows a warning for the implementation of the onDraw(Canvas canvas) function:

'Not annotated parameter overrides @NotNull parameter '

How to solve this (except by disabling the waring at all :-) )?. I've checked the onDraw functions in ImageView and View and do not see any annotations, also some info on a IntelliJ page (https://www.jetbrains.com/idea/documentation/howto.html) does not give a real answer.

Any idea?
2
2
Cristian Garcia's profile photoWerner Dittmann's profile photo
Add a comment...

Werner Dittmann

Android Studio  - 
 
Did AS 0.4.0 changed the way it calls gradle to build APK?

In my build.gradle I use this:

    buildTypes {
        debug {
        }

        develop {
            initWith debug
            signingConfig signingConfigs.sc
            zipAlign true
        }

        alpha {
            initWith release
            signingConfig signingConfigs.sc
            zipAlign true
        }
    }

and AS used to build 'debug' APK when I edited some source and load it to the device. Sine 0.4.0 AS builds the 'alpha' APK and loads it. During development I like to have the 'debug' :-) .

Where can I set / configure AS to build the 'debug' APK? I looked around in the various settings etc but did not found where to configure this. Or is this something I need to add to 'build.gradle'?
1
Scott Culverhouse's profile photoNik Clayton's profile photoWerner Dittmann's profile photo
3 comments
 
Towards the bottom left of the AS UI should be a docked "Build Variants" button.  Press it, and a panel to choose the build variant pops out.
Add a comment...

Werner Dittmann

Shared publicly  - 
 
Next test :-) 
I removed the support lib dependency from the main build.gradle and the error message was gone.

Next I had a subtle error in my main build.gradle. I have additional libs and I wrote it this way:

compile files(':libs/guava-14.0.1.jar')

No error or warning during the build but the classes from jar were somehow not included in the APK. I removed colon before libs, did a gradlew clean and then an assembleDebug. Now the APK seems to be OK, a first test was OK as well. Calling assembleDebug after modification of build.gradle didn't help, only after I called clean and assembled again.

I'm too new to gradle to get all the subtle differences when writing the rules, but this one really gave me some headaches :-)
1
Felix Homann's profile photoWerner Dittmann's profile photo
3 comments
 
+Werner Dittmann Thanks!
Add a comment...

Werner Dittmann

Gradle Build System  - 
 
+Xavier Ducrohet  - After updating to AS 0.8 and the '20' releases I get some warning in gradle.build:

productFlavors' cannot be applied to '(groovy.lang.Closure<com.android.builder.core.DefaultProductFlavor>)' 

The build as such works, for all variants. Seems like an incorrect warning.

These are the relevant parts of build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19

    ... some more definitions
   }
       productFlavors {
        devtest {
            applicationId "com.myapp.app_devtest"
        }
1
Felipe Lima's profile photoWerner Dittmann's profile photoEric Labelle's profile photo
3 comments
 
No, I'm not using 21 because this is an existing project and I cannot change it to 21, not even to API 20 yet (I changed the 'compileSDKVersion' back to 19).

I use AS 0.8 and the platform and build tools releases '20' and the latest revisions of the support repository and support library (6 and 20).
Add a comment...
 
 
In one of my projects I sub-class ImageView. AS shows a warning for the implementation of the onDraw(Canvas canvas) functions:

'Not annotated parameter overrides @NotNull parameter '

How to solve this (except by disabling the waring at all :-) )?. I've checked the onDraw functions in ImageView and View and do not see any annotations, also some info on a IntelliJ page (https://www.jetbrains.com/idea/documentation/howto.html) does not give a real answer.

Any idea?
1
Siva Velusamy's profile photoWerner Dittmann's profile photo
2 comments
 
I tried that in my sub-class, however, AS tells that it does not know about @NotNull. I suspect that I'm missing the annotation JAR or class, similar to the android.annotation.TargetApi class. What should I use here? Any configuration in AS?
Add a comment...

Werner Dittmann

Discussion  - 
 
After the update to AS 0.4.2 I noticed a few new files in the .idea/libraries directory. These files have a 'Gradle__' prefix.

- some of these files mirror already existing (similar) files. The new files seem to add 'Gradle: ' to the 'name' tag. 
- at least one file (Gradle__support_v4_19_0_0.xml) adds a local path: jar://$USER_HOME$/android-sdk-linux_86/... . M project does not use support-v4 directly, only appcompat-v7 which pulls support-v4 via the local maven repository.

Some questions:
What's the purpose of these files?
According to IntelliJ docs files in this directory should go into a VCS. However, if a files contains a local path then this is not a good idea, isn't it?
Because AS seems to add files into '.idea': which AS files should go into a VCS? 
1
Alan Daly's profile photoAlex Ruiz's profile photo
2 comments
 
+Alex Ruiz  love the fact that you link your fixes the way you do, as a novice I learn so much from seeing an issue like this from inception, to fix and see not only what happened, but why it happened and how it was fixed, thank you!
Add a comment...

Werner Dittmann

Discussion  - 
 
I think I've found a C compiler / optimizer problem in Android NDK. I use 'android-ndk-r8e-linux-x86_64'. The compiled code crashes with a SIGBUS (Signal 7), code 1 and this indicates some alignment problems with pointers/addresses. The pointers may hold odd addresses (char*).

If I use the pointers right before the offending C-statement, for example call a dummy function with the pointers as arguments, then everything works fine afterwards. Without changing the offending C-statement It seems that the optimizer in one case produces code that requires even addresses, while this is not the case otherwise.

I'm not the big master on ARM assembler code, thus I just browsed the assembler code and saw differences how the offending C-statement is compiled.

The same C code works on X86 (Linux) without problems (compiled with GCC).

I've created a very small project that includes the C files and the Android.mk and gradle build files. The application crashes on my Nexus 4 (not tested with other devices yet).

Thus my question: how and where to report this problem? Thanks.
1
Siva Velusamy's profile photo
Add a comment...

Werner Dittmann

Shared publicly  - 
 
Felix,

I've tried the gradle scripts as shown in your description and got an error because the build run includes the support lib twice. 

If I leave out the support lib from the main build.gradle then the APK is not built correctly, at least not in my environment which is very similar to what you use.
1
Felix Homann's profile photoWerner Dittmann's profile photo
4 comments
 
+Werner Dittmann I've seen this error too when I tried to import an Eclipse project. I don't remember how I fixed it but it was either:

1. Update the support library in each of your Eclipse projects before exporting, so they all have the same version.

or

2. Let just the main project depend on the support library.
Add a comment...
People
Work
Occupation
IT Consultant and Systemprogrammer
Employment
  • Self-employed
    2013 - present
    Working as IT consultant and system programmer for Linux and Android mainly in security related areas. Recently I did a lot of Android consulting and implementations.
  • Nokia Siemens Networks
    Senior Solution Architect, 2007 - 2012
  • Digital Equipment Corporation
    Senior Systemprogrammer, 1978 - 1981
  • Siemens AG
    Senior Systemprogrammer, 1986 - 2007
Basic Information
Gender
Male
Relationship
Married
Apps with Google+ Sign-in
Story
Introduction
Well, working on various open source projects, mostly security oriented projects. 

My current main project is the implementation of ZRTP (RFC6189) for various communication clients. My GNU ZRTP implementation was tested to work with Phil Zimmermann's ZRTP implementation (Phil invented ZRTP). GNU ZRTP comes in several flavours:
  • GNU ZRTP C++: available for GNU ccRTP (Twinkle SIP client uses this) 
  • GNU ZRTP4J: available for Java/JMF (Jitsi comminication client uses this)
  • GNU ZRTP4PJ: a C wrapper around the C++ classes, available for PJSIP/PJSUA, some clients use this, most prominent is CSipSimple for Android.
Some interesst to implement cryptographic stuff, for example Skein and Threefish for Java and Google's Go language and added a simple to use C API for Skein and Threefish.

Another project I did: started the WebService Security project for Java (WSS4J) at Apache (a long time ago :-) ) together with Davanum Srinivas.
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Previously
München
Links